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

# Update SFTP storage

> Updates SFTP storage configuration and/or credentials including password and SSH key management.
Supports JSON merge patch semantics: "password": null deletes the password, "ssh_key_ids": [] clears all keys.



## OpenAPI

````yaml /api-reference/services_documented/object_storage_api.yaml patch /storage/v4/sftp_storages/{storage_id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Object Storage API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-14T07:00:22.640261+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Notifications
    x-displayName: Notifications
  - name: SSHKeys
    x-displayName: SSHKeys
  - name: Storage Locations
    x-displayName: Storage Locations
  - name: Storage
    x-displayName: Storage
  - name: Storage Statistics
    x-displayName: Storage Statistics
  - name: S3-Compatible Storage
    x-displayName: S3-Compatible Storage
  - name: SFTP Storage
    x-displayName: SFTP Storage
paths:
  /storage/v4/sftp_storages/{storage_id}:
    patch:
      tags:
        - SFTP Storage
      summary: Update SFTP storage
      description: >-
        Updates SFTP storage configuration and/or credentials including password
        and SSH key management.

        Supports JSON merge patch semantics: "password": null deletes the
        password, "ssh_key_ids": [] clears all keys.
      operationId: updateSftpStorageV4
      parameters:
        - name: storage_id
          in: path
          description: Storage ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SFTPStoragePatchBodyV4'
        required: false
      responses:
        '200':
          description: SFTPStorageItemV4
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SFTPStorageItemV4'
        '400':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
        '401':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
        '404':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            sftp_storage = client.storage.sftp_storages.update(
                storage_id=0,
            )
            print(sftp_storage.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/option\"\n\t\"github.com/G-Core/gcore-go/storage\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tsftpStorage, err := client.Storage.SftpStorages.Update(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tstorage.SftpStorageUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", sftpStorage.ID)\n}\n"
components:
  schemas:
    SFTPStoragePatchBodyV4:
      title: >-
        SFTPStoragePatchBodyV4 Request body for updating an SFTP storage. Uses
        JSON merge patch semantics:
      type: object
      properties:
        expires:
          type: string
          description: >-
            Duration when the storage should expire (e.g., "2 years 6 months").
            Empty string to remove.
          example: 2 years 6 months
        has_custom_config_file:
          type: boolean
          description: Whether this storage should use a custom configuration file
          example: false
        is_http_disabled:
          type: boolean
          description: Whether HTTP access should be disabled (HTTPS only)
          example: false
        password_mode:
          type: string
          description: |-
            Password handling mode. Omit to leave password unchanged.
            'auto': regenerate password (returned in response)
            'none': remove password
            Note: 'set' is not allowed in PATCH.
          example: auto
          enum:
            - auto
            - none
        server_alias:
          type: string
          description: >-
            Custom domain alias for accessing the storage. Empty string to
            remove.
          example: my-storage.example.com
        ssh_key_ids:
          type: array
          description: >-
            SSH key IDs to associate with this storage. Replaces all existing
            keys.

            If omitted, existing keys are unchanged. If empty array, all keys
            are removed.
          example:
            - 1
            - 2
            - 3
          items:
            type: integer
            format: int64
      description: |-
        Field absent → no change
        Field present with value → set to that value
        "ssh_key_ids": [] → clear all SSH keys
    SFTPStorageItemV4:
      title: >-
        SFTPStorageItemV4 SFTP storage with connection details and
        authentication config. Connect using address with SSH keys or password.
      required:
        - address
        - created_at
        - expires
        - full_name
        - has_custom_config_file
        - has_password
        - id
        - is_http_disabled
        - location_name
        - name
        - provisioning_status
        - server_alias
        - ssh_key_ids
      type: object
      properties:
        address:
          type: string
          description: Full hostname/address for accessing the storage endpoint
          example: luxembourg-2.storage.example.com
        created_at:
          type: string
          description: ISO 8601 timestamp when the storage was created
          format: date-time
          example: '2025-08-05T09:17:02Z'
        expires:
          type: string
          description: Duration when the storage will expire. Null if no expiration is set.
          example: 2 years 6 months
        full_name:
          type: string
          description: >-
            Read-only internal full name of the storage, composed as
            "{`client_id`}-{name}".

            Used by the SFTP backend as the login username. Clients should use
            this value when connecting

            but should continue to identify the storage by `name` in their own
            configuration.
          example: 696-my-sftp-storage
        has_custom_config_file:
          type: boolean
          description: Whether this storage uses a custom configuration file
          example: false
        has_password:
          type: boolean
          description: Whether password authentication is configured for this storage
          example: true
        id:
          type: integer
          description: Unique identifier for the storage instance
          format: int64
          example: 1
        is_http_disabled:
          type: boolean
          description: Whether HTTP access is disabled for this storage (HTTPS only)
          example: false
        location_name:
          type: string
          description: Geographic location code where the storage is provisioned
          example: luxembourg-2
        name:
          type: string
          description: >-
            User-defined name for the storage instance, as supplied at creation
            time.
          example: my-sftp-storage
        password:
          type: string
          description: >-
            SFTP password. Only returned when newly generated or set
            (create/patch). Omitted in GET/list responses.
          example: Xy9$mN2p!qR8
        provisioning_status:
          type: string
          description: >-
            Lifecycle status of the storage. Use this to check readiness before
            operations.
          example: active
          enum:
            - creating
            - active
            - updating
            - deleting
            - deleted
        server_alias:
          type: string
          description: >-
            Custom domain alias for accessing the storage. Null if no alias is
            configured.
          example: my-storage.example.com
        ssh_key_ids:
          type: array
          description: IDs of SSH keys associated with this SFTP storage
          example:
            - 1
            - 2
          items:
            type: integer
            format: int64
    ErrResponse:
      type: object
      properties:
        error:
          type: string
      description: ErrResponse is an error response
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````