openapi: 3.1.0
info:
  title: Web Hosting Offer API
  description: |-
    Scaleway provides several Web Hosting plans for individuals, professionals, and everyone in between. Our Web Hosting plans include:

    - A domain name
    - A configurable webhosting service
    - The management of your emails, including anti-spam, antivirus and filter systems
    - Unlimited sub-domains
    - An FTP account to upload your website
    - At least one database




    ## Concepts

    Refer to our [dedicated concepts page](https://www.scaleway.com/en/docs/managed-services/webhosting/concepts/) to find definitions of all Web Hosting-related terminology.




    ## Quickstart

    1. Configure your environment variables.

        <Message type="note">
        This is an optional step that seeks to simplify your usage of the Web Hosting API.
        </Message>

        ```bash
        export SCW_SECRET_KEY="<API secret key>"
        export SCW_PROJECT_ID="<Scaleway Project ID>"
        ```

    2. **Choose a Web Hosting offer**: run the following command to list all Web Hosting offers. The `| jq` appendage at the end of the command makes the output easier to read.

        ```bash
        curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            "https://api.scaleway.com/webhosting/v1/regions/fr-par/offers?without_options=true" | jq
        ```

        <Message type="note">
        In the above example, we choose to get offers only. Adjust the query parameter if you would also like to get information about the different options you can add to offers.
        </Message>

    3. **Order a Web Hosting plan**: run the following command to create a Web Hosting plan. You can customize the details in the payload to your needs, using the table below to help.

        ```bash
        curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            "https://api.scaleway.com/webhosting/v1/regions/fr-par/hostings" \
            -d '{
            "domain": "mydomain.net",
            "offer_id": "f5c2ae8f-7625-4bca-b711-b44bb3d08694",
            "project_id": "'"$SCW_PROJECT_ID"'",
            "tags": ["my-tag"]
        }'
        ```

        | Parameter        | Description                                                                            | Valid values OR Example     |
        |------------------|----------------------------------------------------------------------------------------|-----------------------------|
        | `domain`         | The domain name you would like to link to your Web Hosting account. You must already own this domain name and have completed the DNS validation process beforehand.                                                            | `mydomain.net`               |
        | `offer_id`       | The offer ID of the desired offer. Use one of the offer IDs returned in step 2         |`f5c2ae8f-7625-4bca-b711-b44bb3d08694` |
        | `project_id`     | The ID of the Scaleway Project to create the Web Hosting plan in.                      | `277ed74e-ea73-11ed-a05b-0242ac120003`                   |
        | `tags`           | Any tags you would like to associate with this Web Hosting plan                         | `my-tag`                   |


        <Message type="tip">
        Once you've ordered your Web Hosting plan, check out our [dedicated documentation](https://www.scaleway.com/en/docs/managed-services/webhosting/quickstart/) to get started with your configuration.
        </Message>


    4. **Delete your Web Hosting plan**: run the following command to delete your Web Hosting plan. Ensure that you replace `{hosting-id}` in the URL with the ID of the Web Hosting plan you want to delete.

        ```bash
        curl -X DELETE \
            -H "Content-Type: application/json" \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/rest-of-endpoint/{hosting-id}"
        ```


    <Message type="requirement">
    - You have a [Scaleway account](https://console.scaleway.com/)
    - You have created an [API key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/) to perform the actions described on this page
    - You have [installed `curl`](https://curl.se/download.html)
    - You have [installaed `jq`](https://stedolan.github.io/jq/download/)
    </Message>


    ## Technical information

    All Scaleway Web Hosting plans now offer a choice between cPanel and Plesk for website management. Both tools provide a graphical interface and fast access icons, allowing you to configure and monitor your hosting solutions with ease. You can access cPanel or Plesk via the [Scaleway console](https://www.scaleway.com/en/docs/managed-services/webhosting/quickstart/#how-to-access-the-web-hosting-control-panel-from-the-scaleway-console).


    ### Regions

    The Scaleway Web Hosting API is a **regional** API, meaning that each call must specify in its path parameters the region for the resources concerned by the call.

    Scaleway Web Hosting is available only in the `fr-par` region.

    ## Going further

    For more help using Scaleway Web Hosting, check out the following resources:
    - Our [main documentation](https://www.scaleway.com/en/docs/managed-services/webhosting/)
    - The #webhosting-early-access channel on our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/)
    - Our [support ticketing system](https://www.scaleway.com/en/docs/account/how-to/open-a-support-ticket/).
  version: v1
servers:
- url: https://api.scaleway.com
tags:
- name: Offers
  description: |
    Offers represent the available Web Hosting plans and their associated options.
components:
  schemas:
    scaleway.std.LanguageCode:
      type: string
      enum:
      - unknown_language_code
      - en_US
      - fr_FR
      - de_DE
      default: unknown_language_code
    scaleway.webhosting.v1.ControlPanel:
      type: object
      properties:
        name:
          type: string
          description: Control panel name.
        available:
          type: boolean
          description: Define if the control panel type is available to order.
        logo_url:
          type: string
          description: URL of the control panel's logo.
        available_languages:
          type: array
          description: List of available languages for the control panel.
          items:
            $ref: '#/components/schemas/scaleway.std.LanguageCode'
      x-properties-order:
      - name
      - available
      - logo_url
      - available_languages
    scaleway.webhosting.v1.ListOffersResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total number of offers.
          format: uint64
        offers:
          type: array
          description: List of offers.
          items:
            $ref: '#/components/schemas/scaleway.webhosting.v1.Offer'
      x-properties-order:
      - total_count
      - offers
    scaleway.webhosting.v1.Offer:
      type: object
      properties:
        id:
          type: string
          description: Offer ID.
        name:
          type: string
          description: Offer name.
        billing_operation_path:
          type: string
          description: Unique identifier used for billing.
        options:
          type: array
          description: Options available for the offer.
          items:
            $ref: '#/components/schemas/scaleway.webhosting.v1.Offer.Option'
        price:
          type: object
          description: Price of the offer.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        available:
          type: boolean
          description: If a hosting_id was specified in the call, defines whether
            the offer is available for a specified hosting plan to migrate (update)
            to.
        control_panel_name:
          type: string
          description: Name of the control panel.
        end_of_life:
          type: boolean
          description: Indicates if the offer has reached its end of life.
        quota_warning:
          type: string
          description: Defines a warning if the maximum value for an option in the
            offer is exceeded.
          enum:
          - unknown_warning
          - quota_exceeded_warning
          - usage_low_warning
          default: unknown_warning
        control_panels:
          type: array
          description: Lists available control panels for the specified offer.
          items:
            $ref: '#/components/schemas/scaleway.webhosting.v1.ControlPanel'
        commitments:
          type: array
          description: Lists available offer commitments for the specified offer.
          items:
            $ref: '#/components/schemas/scaleway.webhosting.v1.OfferCommitment'
        region:
          type: string
          description: Region where the offer is hosted.
      x-properties-order:
      - id
      - name
      - billing_operation_path
      - options
      - price
      - available
      - control_panel_name
      - end_of_life
      - quota_warning
      - control_panels
      - commitments
      - region
    scaleway.webhosting.v1.Offer.Option:
      type: object
      properties:
        id:
          type: string
          description: Option ID.
        name:
          type: string
          description: Name of the option.
          enum:
          - unknown_name
          - domain_count
          - email_count
          - storage_gb
          - vcpu_count
          - ram_gb
          - backup
          - dedicated_ip
          - email_storage_gb
          - database_count
          - support
          - additional_email
          default: unknown_name
        billing_operation_path:
          type: string
          description: Unique identifier used for billing.
        min_value:
          type: integer
          description: Minimum value for the option in the offer.
          format: int32
        current_value:
          type: integer
          description: If a hosting_id was specified in the call, defines the current
            value of the option in the hosting.
          format: int32
        max_value:
          type: integer
          description: Maximum value for the option in the offer.
          format: int32
        quota_warning:
          type: string
          description: Defines a warning if the maximum value for the option has been
            reached.
          enum:
          - unknown_warning
          - quota_exceeded_warning
          - usage_low_warning
          default: unknown_warning
        price:
          type: object
          description: Price of the option for 1 value.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
      x-properties-order:
      - id
      - name
      - billing_operation_path
      - min_value
      - current_value
      - max_value
      - quota_warning
      - price
    scaleway.webhosting.v1.OfferCommitment:
      type: object
      properties:
        id:
          type: string
          description: Offer commitment ID.
        type:
          type: string
          description: Offer commitment type.
          enum:
          - unknown_commitment_type
          - first_commitment
          - next_commitment
          default: unknown_commitment_type
        billing_mode:
          type: string
          description: Offer commitment name.
          enum:
          - unknown_billing_mode
          - sample
          - purchase_order
          default: unknown_billing_mode
        billing_operation_path:
          type: string
          description: Unique identifier used for billing.
        price:
          type: object
          description: Price of the offer commitment.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        duration_in_month:
          type: integer
          description: Duration of the offer commitment in months.
          format: int32
        next:
          description: Next offer commitment.
          $ref: '#/components/schemas/scaleway.webhosting.v1.OfferCommitment'
      x-properties-order:
      - id
      - type
      - billing_mode
      - billing_operation_path
      - price
      - duration_in_month
      - next
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /webhosting/v1/regions/{region}/offers:
    get:
      tags:
      - Offers
      operationId: ListOffers
      summary: List all available hosting offers along with their specific options.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        description: Page number (must be a positive integer).
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Number of websites to return (must be a positive integer lower
          or equal to 100).
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Sort order for Web Hosting offers in the response.
        schema:
          type: string
          enum:
          - price_asc
          default: price_asc
      - in: query
        name: hosting_id
        description: UUID of the hosting plan.
        schema:
          type: string
      - in: query
        name: control_panels
        description: Name of the control panel(s) to filter for.
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.webhosting.v1.ListOffersResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/webhosting/v1/regions/{region}/offers"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/webhosting/v1/regions/{region}/offers" \
            X-Auth-Token:$SCW_SECRET_KEY
