openapi: 3.1.0
info:
  title: Contract API
  description: The Contract API allows you to manage contracts.
  version: v3
servers:
- url: https://api.scaleway.com
tags:
- name: Contract signatures
  description: Methods to manage contract signatures.
components:
  schemas:
    scaleway.account.v3.CheckContractSignatureResponse:
      type: object
      properties:
        created:
          type: boolean
          description: Whether a signature has been requested for this contract.
        validated:
          type: boolean
          description: Whether the signature for this contract has been validated.
      x-properties-order:
      - created
      - validated
    scaleway.account.v3.ContractSignature:
      type: object
      properties:
        id:
          type: string
          description: ID of the contract signature. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        organization_id:
          type: string
          description: The Organization ID which signed the contract. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        created_at:
          type: string
          description: The creation date of the contract signature. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        signed_at:
          type: string
          description: The signing date of the contract signature. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        expires_at:
          type: string
          description: The expiration date of the contract signature. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        contract:
          type: object
          description: The contract signed.
          properties:
            id:
              type: string
              description: ID of the contract. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            type:
              type: string
              description: The type of the contract.
              enum:
              - unknown_type
              - global
              - k8s
              - instance
              - container
              - baremetal
              - network
              - core
              - vps
              x-enum-descriptions:
                values:
                  unknown_type: Unknown type
                  global: A global contract
                  k8s: Deprecated. A contract specific to the Kubernetes product
                  instance: A contract specific to the Instance product
                  container: A contract specific to Container products
                  baremetal: A contract specific to Baremetal products
                  network: A contract specific to Network products
                  core: A contract specific to Core products
                  vps: A contract specific to VPS products
              default: unknown_type
            name:
              type: string
              description: The name of the contract.
            version:
              type: integer
              description: The version of the contract.
              format: uint32
            created_at:
              type: string
              description: The creation date of the contract. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
            updated_at:
              type: string
              description: The last modification date of the contract. (RFC 3339 format)
              format: date-time
              example: "2022-03-22T12:34:56.123456Z"
              nullable: true
          x-properties-order:
          - id
          - type
          - name
          - version
          - created_at
          - updated_at
      x-properties-order:
      - id
      - organization_id
      - created_at
      - signed_at
      - expires_at
      - contract
    scaleway.account.v3.ListContractSignaturesResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: The total number of contract signatures.
          format: uint64
        contract_signatures:
          type: array
          description: The paginated returned contract signatures.
          items:
            $ref: '#/components/schemas/scaleway.account.v3.ContractSignature'
      x-properties-order:
      - total_count
      - contract_signatures
    scaleway.std.File:
      type: object
      properties:
        name:
          type: string
        content_type:
          type: string
        content:
          type: string
      x-properties-order:
      - name
      - content_type
      - content
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /account/v3/contract-signatures:
    get:
      tags:
      - Contract signatures
      operationId: ListContractSignatures
      summary: List contract signatures for an Organization
      parameters:
      - in: query
        name: page
        description: The page number for the returned contracts.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: The maximum number of contracts per page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: How the contracts are ordered in the response.
        schema:
          type: string
          enum:
          - signed_at_asc
          - signed_at_desc
          - expires_at_asc
          - expires_at_desc
          - name_asc
          - name_desc
          x-enum-descriptions:
            values:
              signed_at_asc: Signing date ascending
              signed_at_desc: Signing date descending
              expires_at_asc: Expiration date ascending
              expires_at_desc: Expiration date descending
              name_asc: Name ascending
              name_desc: Name descending
          default: signed_at_asc
      - in: query
        name: organization_id
        description: Filter on Organization ID. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.account.v3.ListContractSignaturesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/account/v3/contract-signatures?organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/account/v3/contract-signatures" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Contract signatures
      operationId: CreateContractSignature
      summary: Create a signature for your Organization for the latest version of
        the requested contract
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.account.v3.ContractSignature'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contract_type:
                  type: string
                  description: The type of the contract.
                  enum:
                  - unknown_type
                  - global
                  - k8s
                  - instance
                  - container
                  - baremetal
                  - network
                  - core
                  - vps
                  x-enum-descriptions:
                    values:
                      unknown_type: Unknown type
                      global: A global contract
                      k8s: Deprecated. A contract specific to the Kubernetes product
                      instance: A contract specific to the Instance product
                      container: A contract specific to Container products
                      baremetal: A contract specific to Baremetal products
                      network: A contract specific to Network products
                      core: A contract specific to Core products
                      vps: A contract specific to VPS products
                  default: unknown_type
                contract_name:
                  type: string
                  description: The name of the contract.
                validated:
                  type: boolean
                  description: Whether the contract is validated at creation.
                organization_id:
                  type: string
                  description: ID of the Organization. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              x-properties-order:
              - contract_type
              - contract_name
              - validated
              - organization_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "contract_name": "string",
              "organization_id": "6170692e-7363-616c-6577-61792e636f6d",
              "validated": false
            }' \
            "https://api.scaleway.com/account/v3/contract-signatures"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/account/v3/contract-signatures" \
            X-Auth-Token:$SCW_SECRET_KEY \
            contract_name="string" \
            organization_id="6170692e-7363-616c-6577-61792e636f6d" \
            validated:=false
  /account/v3/contract-signatures/{contract_signature_id}/download:
    get:
      tags:
      - Contract signatures
      operationId: DownloadContractSignature
      summary: Download a contract content
      parameters:
      - in: path
        name: contract_signature_id
        description: The contract signature ID. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: locale
        description: The locale requested for the content of the contract.
        schema:
          type: string
          enum:
          - unknown_language_code
          - en_US
          - fr_FR
          - de_DE
          default: unknown_language_code
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.std.File'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/account/v3/contract-signatures/{contract_signature_id}/download"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/account/v3/contract-signatures/{contract_signature_id}/download" \
            X-Auth-Token:$SCW_SECRET_KEY
  /account/v3/contract-signatures/{contract_signature_id}/validate:
    post:
      tags:
      - Contract signatures
      operationId: ValidateContractSignature
      summary: Sign a contract for your Organization
      parameters:
      - in: path
        name: contract_signature_id
        description: The contract linked to your Organization you want to sign. (UUID
          format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.account.v3.ContractSignature'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/account/v3/contract-signatures/{contract_signature_id}/validate"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/account/v3/contract-signatures/{contract_signature_id}/validate" \
            X-Auth-Token:$SCW_SECRET_KEY
  /account/v3/contract-signatures/check:
    post:
      tags:
      - Contract signatures
      operationId: CheckContractSignature
      summary: Check if a contract is signed for your Organization
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.account.v3.CheckContractSignatureResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: string
                  description: ID of the Organization to check the contract signature
                    for. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                contract_type:
                  type: string
                  description: Filter on contract type.
                  enum:
                  - unknown_type
                  - global
                  - k8s
                  - instance
                  - container
                  - baremetal
                  - network
                  - core
                  - vps
                  x-enum-descriptions:
                    values:
                      unknown_type: Unknown type
                      global: A global contract
                      k8s: Deprecated. A contract specific to the Kubernetes product
                      instance: A contract specific to the Instance product
                      container: A contract specific to Container products
                      baremetal: A contract specific to Baremetal products
                      network: A contract specific to Network products
                      core: A contract specific to Core products
                      vps: A contract specific to VPS products
                  default: unknown_type
                contract_name:
                  type: string
                  description: Filter on contract name.
              x-properties-order:
              - organization_id
              - contract_type
              - contract_name
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"contract_name":"string","organization_id":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/account/v3/contract-signatures/check"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/account/v3/contract-signatures/check" \
            X-Auth-Token:$SCW_SECRET_KEY \
            contract_name="string" \
            organization_id="6170692e-7363-616c-6577-61792e636f6d"
