> ## 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.

# Create SFTP storage

> Creates a new SFTP storage instance in the specified location and returns the storage details including credentials.



## OpenAPI

````yaml /api-reference/services_documented/object_storage_api.yaml post /storage/v4/sftp_storages
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-15T06:37:28.230198+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:
    post:
      tags:
        - SFTP Storage
      summary: Create SFTP storage
      description: >-
        Creates a new SFTP storage instance in the specified location and
        returns the storage details including credentials.
      operationId: createSftpStorageV4
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SFTPStorageCreateBodyV4'
        required: true
      responses:
        '201':
          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'
        '403':
          description: ErrResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrResponse'
        '409':
          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.create(
                location_name="s-region-1",
                name="my-sftp-storage",
                password_mode="auto",
            )
            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.New(context.TODO(), storage.SftpStorageNewParams{\n\t\tLocationName: \"s-region-1\",\n\t\tName:         \"my-sftp-storage\",\n\t\tPasswordMode: storage.SftpStorageNewParamsPasswordModeAuto,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", sftpStorage.ID)\n}\n"
components:
  schemas:
    SFTPStorageCreateBodyV4:
      title: SFTPStorageCreateBodyV4 Request body for creating an SFTP storage.
      required:
        - location_name
        - name
        - password_mode
      type: object
      properties:
        expires:
          type: string
          description: >-
            Duration when the storage should expire (e.g., "2 years 6 months").
            Omit for no expiration.
          example: 2 years 6 months
        has_custom_config_file:
          type: boolean
          description: Whether this storage should use a custom configuration file
          example: false
          x-stainless-terraform-configurability: computed_optional
        is_http_disabled:
          type: boolean
          description: Whether HTTP access should be disabled (HTTPS only)
          example: false
          x-stainless-terraform-configurability: computed_optional
        location_name:
          type: string
          description: Location code where the storage should be created
          example: s-region-1
        name:
          type: string
          description: User-defined name for the storage instance
          example: my-sftp-storage
        password_mode:
          type: string
          description: |-
            Password handling mode for SFTP access:
            'auto': generate a random password (returned in the response)
            'set': use the password provided in `sftp_password`
            'none': no password (SSH-key-only access)
          example: auto
          enum:
            - auto
            - set
            - none
        server_alias:
          type: string
          description: Custom domain alias for accessing the storage. Omit for no alias.
          example: my-storage.example.com
          x-stainless-terraform-configurability: computed_optional
        sftp_password:
          type: string
          description: |-
            SFTP password (8-63 chars). Required when `password_mode` is 'set'.
            Must be omitted when `password_mode` is 'auto' or 'none'.
        ssh_key_ids:
          type: array
          description: >-
            SSH key IDs to associate with this storage at creation time. If
            omitted, no keys are linked.
          example:
            - 1
            - 2
            - 3
          items:
            type: integer
            format: int64
          x-stainless-terraform-configurability: computed_optional
    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

````