Skip to content

Secret Connections API

View as Markdown

Set up your agent

Give your coding agent a Steel browser and the Steel skills, so that it browses and writes Steel code the right way. Learn more

Install the Steel CLI. It signs you in and installs the skills for your coding agents.

curl -fsS https://setup.steel.dev | sh

Or send this prompt to your coding agent, and it does the same:

Read https://setup.steel.dev/install.md and follow it to set up Steel for this coding client.
Then continue my requested task using the installed Steel skill.

Set up your agent →

A Secret Connection gives a project access to 1Password or HashiCorp Vault (KV version 2). These endpoints create, list, get, update, delete and test Secret Connections. For the base URL and authentication, see API conventions. For providers, bindings and authentication rules, see Secret Connections.

The first example is a complete program. The later examples use its client, and the ID of a Secret Connection in CONNECTION_ID (cURL), connectionId (TypeScript), connection_id (Python and Rust) or connectionID (Go).

Endpoints

List Secret Connections

GET/v1/secret-connections

Lists the Secret Connections in a project. The response does not include provider authentication.

Parameters

NameTypeRequiredDescription
projectIdstring (uuid) · queryNoThe project whose Secret Connections to list.

Response

FieldTypeDescription
connectionsobject[]The Secret Connections, each with the fields in Create a Secret Connection.
list-secret-connections.mts
import Steel from "steel-sdk";

const client = new Steel();
const result = await client.secretConnections.list();

for (const connection of result.connections) {
  console.log(connection.id, connection.name);
}

Create a Secret Connection

POST/v1/secret-connections

Creates a Secret Connection. The API accepts authentication when you create it but never returns it.

Parameters

NameTypeRequiredDescription
namestring · bodyYesA name for the Secret Connection.
providerstring · bodyYes1password or hashicorp_vault.
authobject · bodyYesWrite-only provider authentication. Send serviceAccountToken for 1Password, token for HashiCorp Vault token authentication, or roleId and secretId for AppRole.
configobject · bodyNoHashiCorp Vault settings. address is required when this object is present; namespace and caPem are optional.
projectIdstring (uuid) · bodyNoThe project to create the Secret Connection in.
tokenBudgetobject or null · bodyNoThe provider request budget. Set null for the default budget.

The response is 201 with the Secret Connection:

Response

FieldTypeDescription
idstring (uuid)The Secret Connection ID.
namestringThe Secret Connection name.
providerstring1password or hashicorp_vault.
enabledbooleanWhether Steel can make later reads from the provider.
tokenBudgetobject or nullThe provider request budget, or null for the default budget.
vaultFingerprintstringA diagnostic fingerprint of accessible 1Password vault IDs, or of the HashiCorp Vault endpoint and namespace. It does not prove account or server identity.
versionintegerThe Secret Connection version.
createdAtstring (date-time)When the Secret Connection was created.
updatedAtstring (date-time)When the Secret Connection last changed.

See 1Password and HashiCorp Vault.

const connection = await client.secretConnections.create({
  name: "team-1password",
  provider: "1password",
  auth: { serviceAccountToken: process.env.OP_SERVICE_ACCOUNT_TOKEN! },
});
console.log(connection.id, connection.name);

Get a Secret Connection

GET/v1/secret-connections/{id}

Returns one Secret Connection without its provider authentication.

Parameters

NameTypeRequiredDescription
idstring (uuid) · pathYesThe Secret Connection ID.
projectIdstring (uuid) · queryNoThe Secret Connection's project.

The response is the Secret Connection object, with the fields in Create a Secret Connection.

const connection = await client.secretConnections.retrieve(connectionId);
console.log(connection.provider, connection.enabled);

Update a Secret Connection

PATCH/v1/secret-connections/{id}

Changes a Secret Connection. Send provider authentication to replace it; the API does not return that authentication.

Parameters

NameTypeRequiredDescription
idstring (uuid) · pathYesThe Secret Connection ID.
projectIdstring (uuid) · queryNoThe Secret Connection's project.

The response is the Secret Connection object, with the fields in Create a Secret Connection.

When you replace authentication, Steel verifies that it can still reach what running sessions have bound. See connection_account_mismatch.

const connection = await client.secretConnections.update(connectionId, {
  auth: { serviceAccountToken: process.env.OP_SERVICE_ACCOUNT_TOKEN! },
});
console.log(connection.updatedAt);

Delete a Secret Connection

DELETE/v1/secret-connections/{id}

Deletes a Secret Connection.

Parameters

NameTypeRequiredDescription
idstring (uuid) · pathYesThe Secret Connection ID.
projectIdstring (uuid) · queryNoThe Secret Connection's project.

The response is 204 with no body.

await client.secretConnections.delete(connectionId);

Test a Secret Connection

POST/v1/secret-connections/{id}/test

Checks whether Steel can authenticate with the provider. It does not change the Secret Connection or verify that a binding can fill a login.

Parameters

NameTypeRequiredDescription
idstring (uuid) · pathYesThe Secret Connection ID.
projectIdstring (uuid) · queryNoThe Secret Connection's project.

The response is 204 with no body.

See Secret Connections.

await client.secretConnections.test(connectionId);
Was this page helpful?