mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-28 11:40:32 +00:00
85 lines
2.4 KiB
Text
85 lines
2.4 KiB
Text
---
|
|
title: "update_credential"
|
|
slug: sdk-reference/credentials/update-credential
|
|
---
|
|
|
|
Overwrite the stored credential data (e.g. username/password) while keeping the same credential ID.
|
|
|
|
<CodeGroup>
|
|
```python Python
|
|
updated = await client.update_credential(
|
|
"cred_abc123",
|
|
name="Updated Login",
|
|
credential_type="password",
|
|
credential={
|
|
"username": "new_user@example.com",
|
|
"password": "new_password",
|
|
},
|
|
)
|
|
```
|
|
|
|
```typescript TypeScript
|
|
const updated = await skyvern.updateCredential("cred_abc123", {
|
|
name: "Updated Login",
|
|
credential_type: "password",
|
|
credential: {
|
|
username: "new_user@example.com",
|
|
password: "new_password",
|
|
},
|
|
});
|
|
```
|
|
</CodeGroup>
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
|-----------|------|----------|-------------|
|
|
| `credential_id` | `str` | Yes | The credential ID to update. |
|
|
| `name` | `str` | Yes | Name of the credential. |
|
|
| `credential_type` | `str` | Yes | Type of credential (`"password"`, `"credit_card"`, `"secret"`). |
|
|
| `credential` | `dict` | Yes | The new credential data. |
|
|
| `vault_type` | `CredentialVaultType` | No | Vault provider. |
|
|
| `request_options` | `RequestOptions` | No | Per-request configuration (see below). |
|
|
|
|
### Returns `CredentialResponse`
|
|
|
|
---
|
|
|
|
### Request options
|
|
|
|
|
|
Override timeout, retries, or headers for this call by passing `request_options` (Python) or a second options argument (TypeScript).
|
|
|
|
<CodeGroup>
|
|
```python Python
|
|
from skyvern.client.core import RequestOptions
|
|
|
|
request_options=RequestOptions(
|
|
timeout_in_seconds=120,
|
|
max_retries=3,
|
|
additional_headers={"x-custom-header": "value"},
|
|
)
|
|
```
|
|
|
|
```typescript TypeScript
|
|
// Pass as second argument to any method
|
|
{
|
|
timeoutInSeconds: 120,
|
|
maxRetries: 3,
|
|
headers: { "x-custom-header": "value" },
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
| Option (Python) | Option (TypeScript) | Type | Description |
|
|
|-----------------|---------------------|------|-------------|
|
|
| `timeout_in_seconds` | `timeoutInSeconds` | `int` / `number` | HTTP timeout in seconds. |
|
|
| `max_retries` | `maxRetries` | `int` / `number` | Retry count. |
|
|
| `additional_headers` | `headers` | `dict` / `Record<string, string>` | Extra headers. |
|
|
| `additional_query_parameters` | - | `dict` | Extra query parameters. |
|
|
| `additional_body_parameters` | - | `dict` | Extra body parameters. |
|
|
| - | `abortSignal` | `AbortSignal` | Signal to cancel the request. |
|
|
| - | `apiKey` | `string` | Override API key. |
|
|
|
|
|
|
---
|