> ## Documentation Index
> Fetch the complete documentation index at: https://skyvern.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update credential

> Overwrites the stored credential data (e.g. username/password) while keeping the same credential_id.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/credentials/{credential_id}/update
openapi: 3.1.0
info:
  title: Skyvern API
  description: API for Skyvern
  version: 1.0.0
servers:
  - url: https://api.skyvern.com
    x-fern-server-name: Cloud
  - url: https://api-staging.skyvern.com
    x-fern-server-name: Staging
  - url: http://localhost:8000
    x-fern-server-name: Local
security: []
paths:
  /v1/credentials/{credential_id}/update:
    post:
      tags:
        - Credentials
      summary: Update credential
      description: >-
        Overwrites the stored credential data (e.g. username/password) while
        keeping the same credential_id.
      operationId: update_credential_v1_credentials__credential_id__update_post
      parameters:
        - name: credential_id
          in: path
          required: true
          schema:
            type: string
            description: The unique identifier of the credential to update
            examples:
              - cred_1234567890
            openapi_extra:
              x-fern-sdk-parameter-name: credential_id
            title: Credential Id
          description: The unique identifier of the credential to update
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Skyvern API key for authentication. API key can be found at
              https://app.skyvern.com/settings.
            title: X-Api-Key
          description: >-
            Skyvern API key for authentication. API key can be found at
            https://app.skyvern.com/settings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCredentialRequest'
              description: The new credential data to store
              examples:
                - name: My Credential
                  credential_type: PASSWORD
                  credential:
                    username: user@example.com
                    password: newpassword123
              openapi_extra:
                x-fern-sdk-parameter-name: data
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateCredentialRequest:
      properties:
        name:
          type: string
          title: Name
          description: Name of the credential
          examples:
            - Amazon Login
        credential_type:
          $ref: >-
            #/components/schemas/skyvern__forge__sdk__schemas__credentials__CredentialType
          description: Type of credential to create
        credential:
          anyOf:
            - $ref: '#/components/schemas/NonEmptyPasswordCredential'
            - $ref: '#/components/schemas/NonEmptyCreditCardCredential'
            - $ref: '#/components/schemas/SecretCredential'
          title: Credential
          description: The credential data to store
          examples:
            - password: securepassword123
              username: user@example.com
        vault_type:
          anyOf:
            - $ref: '#/components/schemas/CredentialVaultType'
            - type: 'null'
          description: >-
            Which vault to store this credential in. If omitted, uses the
            instance default. Use this to mix Skyvern-hosted and custom
            credentials within the same organization.
          examples:
            - custom
            - azure_vault
            - bitwarden
        proxy_location:
          anyOf:
            - $ref: '#/components/schemas/ProxyLocation'
            - $ref: '#/components/schemas/GeoTarget'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Proxy Location
          description: Optional proxy location for this credential's pinned proxy identity.
        proxy_session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proxy Session Id
          description: >-
            Optional advanced reuse key for this credential's pinned proxy
            identity.
      type: object
      required:
        - name
        - credential_type
        - credential
      title: CreateCredentialRequest
      description: Request model for creating a new credential.
    CredentialResponse:
      properties:
        credential_id:
          type: string
          title: Credential Id
          description: Unique identifier for the credential
          examples:
            - cred_1234567890
        credential:
          anyOf:
            - $ref: '#/components/schemas/PasswordCredentialResponse'
            - $ref: '#/components/schemas/CreditCardCredentialResponse'
            - $ref: '#/components/schemas/SecretCredentialResponse'
          title: Credential
          description: The credential data
        credential_type:
          $ref: '#/components/schemas/CredentialType-Output'
          description: Type of the credential
        name:
          type: string
          title: Name
          description: Name of the credential
          examples:
            - Amazon Login
        vault_type:
          anyOf:
            - $ref: '#/components/schemas/CredentialVaultType'
            - type: 'null'
          description: >-
            Which vault stores this credential (e.g., 'bitwarden',
            'azure_vault', 'custom')
        browser_profile_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Browser Profile Id
          description: Browser profile ID linked to this credential
        tested_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Tested Url
          description: Login page URL used during the credential test
        user_context:
          anyOf:
            - type: string
            - type: 'null'
          title: User Context
          description: >-
            User-provided context describing the login sequence (e.g., 'click
            SSO button first')
        save_browser_session_intent:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Save Browser Session Intent
          description: >-
            Whether the user intends to save a browser session, regardless of
            test outcome
        folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Folder Id
          description: ID of the credential folder this credential belongs to, if any
          examples:
            - cfld_1234567890
        proxy_location:
          anyOf:
            - $ref: '#/components/schemas/ProxyLocation'
            - $ref: '#/components/schemas/GeoTarget'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Proxy Location
          description: >-
            Optional proxy location used for the credential's pinned proxy
            identity.
        proxy_session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proxy Session Id
          description: Opaque Skyvern-managed proxy sticky-session id.
      type: object
      required:
        - credential_id
        - credential
        - credential_type
        - name
      title: CredentialResponse
      description: Response model for credential operations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    skyvern__forge__sdk__schemas__credentials__CredentialType:
      type: string
      enum:
        - password
        - credit_card
        - secret
      title: CredentialType
      description: Type of credential stored in the system.
    NonEmptyPasswordCredential:
      properties:
        password:
          type: string
          minLength: 1
          title: Password
          description: The password value (must not be empty)
          examples:
            - securepassword123
        username:
          type: string
          minLength: 1
          title: Username
          description: The username associated with the credential (must not be empty)
          examples:
            - user@example.com
        totp:
          anyOf:
            - type: string
            - type: 'null'
          title: Totp
          description: >-
            Optional TOTP (Time-based One-Time Password) string used to generate
            2FA codes
          examples:
            - JBSWY3DPEHPK3PXP
        totp_type:
          $ref: '#/components/schemas/TotpType'
          description: Type of 2FA method used for this credential
          default: none
          examples:
            - authenticator
        totp_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Totp Identifier
          description: Identifier (email or phone number) used to fetch TOTP codes
          examples:
            - user@example.com
            - '+14155550123'
      type: object
      required:
        - password
        - username
      title: NonEmptyPasswordCredential
      description: Password credential model that requires non-empty values.
    NonEmptyCreditCardCredential:
      properties:
        card_number:
          type: string
          minLength: 1
          title: Card Number
          description: The full credit card number (must not be empty)
          examples:
            - '4111111111111111'
        card_cvv:
          type: string
          minLength: 1
          title: Card Cvv
          description: The card's CVV (must not be empty)
          examples:
            - '123'
        card_exp_month:
          type: string
          minLength: 1
          title: Card Exp Month
          description: The card's expiration month (must not be empty)
          examples:
            - '12'
        card_exp_year:
          type: string
          minLength: 1
          title: Card Exp Year
          description: The card's expiration year (must not be empty)
          examples:
            - '2025'
        card_brand:
          type: string
          minLength: 1
          title: Card Brand
          description: The card's brand (must not be empty)
          examples:
            - visa
        card_holder_name:
          type: string
          minLength: 1
          title: Card Holder Name
          description: The name of the card holder (must not be empty)
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/CreditCardBillingAddress'
            - type: 'null'
          description: Optional billing address associated with the card
        billing_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Email
          description: Optional billing email address
        billing_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Phone
          description: Optional billing phone number
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
          description: Optional additional credit card metadata fields
      type: object
      required:
        - card_number
        - card_cvv
        - card_exp_month
        - card_exp_year
        - card_brand
        - card_holder_name
      title: NonEmptyCreditCardCredential
      description: Credit card credential model that requires non-empty values.
    SecretCredential:
      properties:
        secret_value:
          type: string
          minLength: 1
          title: Secret Value
          description: The secret value
          examples:
            - sk-abc123
        secret_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Secret Label
          description: Optional label describing the secret
      type: object
      required:
        - secret_value
      title: SecretCredential
      description: Generic secret credential.
    CredentialVaultType:
      type: string
      enum:
        - bitwarden
        - azure_vault
        - gcp
        - custom
      title: CredentialVaultType
    ProxyLocation:
      type: string
      enum:
        - RESIDENTIAL
        - US-CA
        - US-NY
        - US-TX
        - US-FL
        - US-WA
        - RESIDENTIAL_ES
        - RESIDENTIAL_IE
        - RESIDENTIAL_GB
        - RESIDENTIAL_IN
        - RESIDENTIAL_JP
        - RESIDENTIAL_FR
        - RESIDENTIAL_DE
        - RESIDENTIAL_NZ
        - RESIDENTIAL_ZA
        - RESIDENTIAL_AR
        - RESIDENTIAL_AU
        - RESIDENTIAL_BR
        - RESIDENTIAL_TR
        - RESIDENTIAL_CA
        - RESIDENTIAL_MX
        - RESIDENTIAL_IT
        - RESIDENTIAL_NL
        - RESIDENTIAL_PH
        - RESIDENTIAL_KR
        - RESIDENTIAL_SA
        - RESIDENTIAL_ISP
        - NONE
      title: ProxyLocation
    GeoTarget:
      properties:
        country:
          type: string
          maxLength: 2
          minLength: 2
          title: Country
          description: ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'DE')
          examples:
            - US
            - GB
            - DE
            - FR
        subdivision:
          anyOf:
            - type: string
              maxLength: 10
            - type: 'null'
          title: Subdivision
          description: >-
            ISO 3166-2 subdivision code without country prefix (e.g., 'CA' for
            California, 'NY' for New York)
          examples:
            - CA
            - NY
            - TX
            - ENG
        city:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: City
          description: >-
            City name in English from GeoNames (e.g., 'New York', 'Los Angeles',
            'London')
          examples:
            - New York
            - Los Angeles
            - London
            - Berlin
      type: object
      required:
        - country
      title: GeoTarget
      description: >-
        Granular proxy geo-targeting request with country, optional subdivision,
        and optional city.
    PasswordCredentialResponse:
      properties:
        username:
          type: string
          title: Username
          description: The username associated with the credential
          examples:
            - user@example.com
        totp_type:
          $ref: '#/components/schemas/TotpType'
          description: Type of 2FA method used for this credential
          default: none
          examples:
            - authenticator
        totp_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Totp Identifier
          description: Identifier (email or phone number) used to fetch TOTP codes
          examples:
            - user@example.com
            - '+14155550123'
      type: object
      required:
        - username
      title: PasswordCredentialResponse
      description: |-
        Response model for password credentials — non-sensitive fields only.

        SECURITY: Must NEVER include password or TOTP secret.
    CreditCardCredentialResponse:
      properties:
        last_four:
          type: string
          title: Last Four
          description: Last four digits of the credit card number
          examples:
            - '1234'
        brand:
          type: string
          title: Brand
          description: Brand of the credit card
          examples:
            - visa
      type: object
      required:
        - last_four
        - brand
      title: CreditCardCredentialResponse
      description: >-
        Response model for credit card credentials — non-sensitive fields only.


        SECURITY: Must NEVER include full card number, CVV, expiration date,
        card holder name,

        billing fields, or metadata.
    SecretCredentialResponse:
      properties:
        secret_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Secret Label
          description: Optional label for the stored secret
      type: object
      title: SecretCredentialResponse
      description: |-
        Response model for secret credentials — non-sensitive fields only.

        SECURITY: Must NEVER include the secret_value.
    CredentialType-Output:
      type: string
      enum:
        - password
        - credit_card
        - secret
      title: CredentialType
      description: Type of credential stored in the system.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TotpType:
      type: string
      enum:
        - authenticator
        - email
        - text
        - none
      title: TotpType
      description: Type of 2FA/TOTP method used.
    CreditCardBillingAddress:
      properties:
        line1:
          anyOf:
            - type: string
            - type: 'null'
          title: Line1
          description: Billing address line 1
          examples:
            - 123 Main St
        line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Line2
          description: Billing address line 2
          examples:
            - Apt 4B
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: Billing city
          examples:
            - San Francisco
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: Billing state or region
          examples:
            - California
        state_code:
          anyOf:
            - type: string
            - type: 'null'
          title: State Code
          description: Billing state or region code
          examples:
            - CA
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Postal Code
          description: Billing postal code
          examples:
            - '94105'
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Billing country
          examples:
            - United States
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: ISO 3166-1 alpha-2 billing country code
          examples:
            - US
      type: object
      title: CreditCardBillingAddress
      description: >-
        Optional billing address fields associated with a credit card
        credential.

````