---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/reference/api/credentials
markdown_url: https://steel.dev/docs/reference/api/credentials.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: Credentials API
description: Store, list, update and delete the logins that a session fills into sign-in forms, with the Steel API.
summary: Store, list, update and delete the logins that a session fills into sign-in forms, with the Steel API.
type: reference
stage: beta
reviewed: 2026-11-12
prerequisites: []
related:
  - https://steel.dev/docs/reference/api/quick-actions.md
  - https://steel.dev/docs/reference/api/profiles.md
  - https://steel.dev/docs/reference/api/files.md
  - https://steel.dev/docs/reference/api/extensions.md
  - https://steel.dev/docs/reference/api/projects.md
agent_setup: https://setup.steel.dev/install.md
docs_index: https://steel.dev/docs/sitemap.md
---

# Credentials API

A credential is a login that Steel stores encrypted and fills in on its origin's sign-in pages. Its `origin` and `namespace` identify it. These endpoints store, list, update and delete credentials. For the base URL and authentication, see [API conventions](https://steel.dev/docs/reference/api). For the error codes, see [Errors](https://steel.dev/docs/reference/errors).

The first example is a complete program that stores a login for `https://app.example.com`, with the password from the `SITE_PASSWORD` environment variable. The later examples use its `client`.

## Endpoints

### Store a credential

```http
POST /v1/credentials
```

Encrypts and stores the credential of one origin.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `origin` | body | string | no | `"default"` | The website origin of the credential, such as `https://app.example.com`. Set it. Without it, the origin is `"default"`, which matches no page. |
| `value` | body | object | yes | | The credential, as string fields: `username`, `password`, and `totpSecret` for one-time passwords. |
| `label` | body | string | no | | A label for the credential. |
| `namespace` | body | string | no | `"default"` | The namespace of the credential. A session uses the credentials of its own namespace. |
| `projectId` | body | string (uuid) | no | | The project to store the credential in. Required with an organization key. |

The response is `201`:

| Field | Type | Description |
| - | - | - |
| `origin` | string | The website origin of the credential. |
| `namespace` | string | The namespace of the credential. |
| `label` | string | The label of the credential. |
| `createdAt` | string (date-time) | When the credential was created. |
| `updatedAt` | string (date-time) | When the credential last changed. |

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/credentials \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"origin\": \"https://app.example.com\", \"value\": {\"username\": \"user@example.com\", \"password\": \"$SITE_PASSWORD\"}}"
```

**TypeScript**

```ts file=store-credential.mts
import Steel from "steel-sdk";

const client = new Steel();
const credential = await client.credentials.create({
  origin: "https://app.example.com",
  value: {
    username: "user@example.com",
    password: process.env.SITE_PASSWORD!,
  },
});

console.log(credential.origin, credential.namespace);
```

**Python**

```python file=store-credential.py
import os

from steel import Steel

client = Steel()
credential = client.credentials.create(
    origin="https://app.example.com",
    value={
        "username": "user@example.com",
        "password": os.environ["SITE_PASSWORD"],
    },
)

print(credential.origin, credential.namespace)
```

**Go**

```go file=main.go
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/steel-dev/sdk/go"
)

func main() {
	if err := run(context.Background()); err != nil {
		log.Fatal(err)
	}
}

func run(ctx context.Context) error {
	client := steel.NewClient()
	credential, err := client.Credentials.New(ctx, steel.CredentialNewParams{
		Origin: steel.F("https://app.example.com"),
		Value: steel.F(map[string]string{
			"username": "user@example.com",
			"password": os.Getenv("SITE_PASSWORD"),
		}),
	})
	if err != nil {
		return err
	}

	fmt.Println(credential.Origin, credential.Namespace)
	return nil
}
```

**Rust**

```rust file=src/main.rs
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = steel_rs::Client::new();
    let credential = client
        .credentials()
        .create(steel_rs::CredentialCreateParams {
            origin: Some("https://app.example.com".to_owned()),
            ..steel_rs::CredentialCreateParams::new(std::collections::HashMap::from([
                ("username".to_owned(), "user@example.com".to_owned()),
                ("password".to_owned(), std::env::var("SITE_PASSWORD")?),
            ]))
        })
        .await?;

    let origin = credential.origin.unwrap_or_default();
    let namespace = credential.namespace.unwrap_or_default();
    println!("{origin} {namespace}");
    Ok(())
}
```

See [Credentials](https://steel.dev/docs/logins/credentials).

### List credentials

```http
GET /v1/credentials
```

Lists the stored credentials of one namespace. The response holds their metadata, never their values.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `projectId` | query | string (uuid) | no | | The project whose credentials to list. Required with an organization key. |
| `namespace` | query | string | no | `"default"` | The namespace whose credentials to list. The response never holds other namespaces. |
| `origin` | query | string | no | | The origin whose credentials to list. |

| Field | Type | Description |
| - | - | - |
| `credentials` | object\[] | The credentials, each with `origin`, `namespace`, `label`, `createdAt` and `updatedAt`. |

**cURL**

```sh
curl https://api.steel.dev/v1/credentials \
  -H "steel-api-key: $STEEL_API_KEY"
```

**TypeScript**

```ts
const { credentials } = await client.credentials.list();

for (const credential of credentials) {
  console.log(credential.origin, credential.namespace);
}
```

**Python**

```python
result = client.credentials.list()

for credential in result.credentials:
    print(credential.origin, credential.namespace)
```

**Go**

```go
result, err := client.Credentials.List(ctx, steel.CredentialListParams{})
if err != nil {
	return err
}

for _, credential := range result.Credentials {
	fmt.Println(credential.Origin, credential.Namespace)
}
```

**Rust**

```rust
let result = client
    .credentials()
    .list(steel_rs::CredentialListParams::default())
    .await?;

for credential in result.credentials {
    let origin = credential.origin.unwrap_or_default();
    let namespace = credential.namespace.unwrap_or_default();
    println!("{origin} {namespace}");
}
```

See [Credentials](https://steel.dev/docs/logins/credentials).

### Update a credential

```http
PUT /v1/credentials
```

Encrypts and stores new values for the credential of one origin.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `origin` | body | string | no | | The website origin of the credential. |
| `value` | body | object | no | | The new credential, as string fields. |
| `label` | body | string | no | | A new label. |
| `namespace` | body | string | no | `"default"` | The namespace of the credential. |
| `projectId` | body | string (uuid) | no | | The credential's project. Required with an organization key. |

The response has the fields in [Store a credential](https://steel.dev/docs/reference/api/credentials#store-a-credential).

**cURL**

```sh
curl -X PUT https://api.steel.dev/v1/credentials \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"origin\": \"https://app.example.com\", \"value\": {\"username\": \"user@example.com\", \"password\": \"$SITE_PASSWORD\"}}"
```

**TypeScript**

```ts
await client.credentials.update({
  origin: "https://app.example.com",
  value: {
    username: "user@example.com",
    password: process.env.SITE_PASSWORD!,
  },
});
```

**Python**

```python
client.credentials.update(
    origin="https://app.example.com",
    value={
        "username": "user@example.com",
        "password": os.environ["SITE_PASSWORD"],
    },
)
```

**Go**

```go
import "os"

if _, err := client.Credentials.Update(ctx, steel.CredentialUpdateParams{
	Origin: steel.F("https://app.example.com"),
	Value: steel.F(map[string]string{
		"username": "user@example.com",
		"password": os.Getenv("SITE_PASSWORD"),
	}),
}); err != nil {
	return err
}
```

**Rust**

```rust
client
    .credentials()
    .update(steel_rs::CredentialUpdateParams {
        origin: Some("https://app.example.com".to_owned()),
        value: Some(std::collections::HashMap::from([
            ("username".to_owned(), "user@example.com".to_owned()),
            ("password".to_owned(), std::env::var("SITE_PASSWORD")?),
        ])),
        ..Default::default()
    })
    .await?;
```

See [Credentials](https://steel.dev/docs/logins/credentials).

### Delete a credential

```http
DELETE /v1/credentials
```

Deletes the credential of one origin.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `origin` | body | string | yes | | The website origin of the credential. |
| `namespace` | body | string | no | `"default"` | The namespace of the credential. |
| `projectId` | body | string (uuid) | no | | The project to delete the credential from. Required with an organization key. |

| Field | Type | Description |
| - | - | - |
| `success` | boolean | Whether the credential was deleted. |

**cURL**

```sh
curl -X DELETE https://api.steel.dev/v1/credentials \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin": "https://app.example.com"}'
```

**TypeScript**

```ts
const result = await client.credentials.delete({
  origin: "https://app.example.com",
});
console.log(result.success);
```

**Python**

```python
result = client.credentials.delete(origin="https://app.example.com")
print(result.success)
```

**Go**

```go
result, err := client.Credentials.Delete(ctx, steel.CredentialDeleteParams{
	Origin: steel.F("https://app.example.com"),
})
if err != nil {
	return err
}
fmt.Println(result.Success)
```

**Rust**

```rust
let result = client
    .credentials()
    .delete(steel_rs::CredentialDeleteParams::new(
        "https://app.example.com".to_owned(),
    ))
    .await?;
println!("{}", result.success);
```

See [Credentials](https://steel.dev/docs/logins/credentials).
