/ openapi.yaml
openapi.yaml
   1  openapi: 3.0.3
   2  
   3  info:
   4    version: 0.0.1
   5    title: Codex API
   6    description: "List of endpoints and interfaces available to Codex API users"
   7  
   8  security:
   9    - {}
  10  
  11  components:
  12    schemas:
  13      MultiAddress:
  14        type: string
  15        description: Address of node as specified by the multi-address specification https://multiformats.io/multiaddr/
  16        example: /ip4/127.0.0.1/tcp/8080
  17  
  18      PeerId:
  19        type: string
  20        description: Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/
  21        example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
  22  
  23      Id:
  24        type: string
  25        description: 32bits identifier encoded in hex-decimal string.
  26        minLength: 66
  27        maxLength: 66
  28        example: 0x...
  29  
  30      Cid:
  31        type: string
  32        description: Content Identifier as specified at https://github.com/multiformats/cid
  33        example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
  34  
  35      SlotId:
  36        type: string
  37        description: Keccak hash of the abi encoded tuple (RequestId, slot index)
  38        example: 268a781e0db3f7cf36b18e5f4fdb7f586ec9edd08e5500b17c0e518a769f114a
  39  
  40      LogLevel:
  41        type: string
  42        description: "One of the log levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL"
  43        example: DEBUG
  44  
  45      EthereumAddress:
  46        type: string
  47        description: Address of Ethereum address
  48  
  49      PricePerBytePerSecond:
  50        type: string
  51        description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay
  52  
  53      CollateralPerByte:
  54        type: string
  55        description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
  56  
  57      Duration:
  58        type: integer
  59        format: int64
  60        description: The duration of the request in seconds
  61  
  62      ProofProbability:
  63        type: string
  64        description: How often storage proofs are required as decimal string
  65  
  66      Expiry:
  67        type: integer
  68        format: int64
  69        description: A timestamp as seconds since unix epoch at which this request expires if the Request does not find requested amount of nodes to host the data.
  70  
  71      SPR:
  72        type: string
  73        description: Signed Peer Record (libp2p)
  74  
  75      SPRRead:
  76        type: object
  77        required:
  78          - spr
  79        properties:
  80          spr:
  81            $ref: "#/components/schemas/SPR"
  82  
  83      PeerIdRead:
  84        type: object
  85        properties:
  86          id:
  87            $ref: "#/components/schemas/PeerId"
  88  
  89      Content:
  90        type: object
  91        required:
  92          - cid
  93        description: Parameters specifying the content
  94        properties:
  95          cid:
  96            $ref: "#/components/schemas/Cid"
  97  
  98      Node:
  99        type: object
 100        required:
 101          - nodeId
 102          - peerId
 103          - record
 104          - address
 105          - seen
 106        properties:
 107          nodeId:
 108            type: string
 109          peerId:
 110            type: string
 111          record:
 112            type: string
 113          address:
 114            type: string
 115          seen:
 116            type: boolean
 117  
 118      CodexVersion:
 119        type: object
 120        properties:
 121          version:
 122            type: string
 123            example: v0.1.7
 124          revision:
 125            type: string
 126            example: 0c647d8
 127          contracts:
 128            type: string
 129            example: 0b537c7
 130  
 131      PeersTable:
 132        type: object
 133        required:
 134          - localNode
 135          - nodes
 136        properties:
 137          localNode:
 138            $ref: "#/components/schemas/Node"
 139          nodes:
 140            type: array
 141            items:
 142              $ref: "#/components/schemas/Node"
 143  
 144      DebugInfo:
 145        type: object
 146        required:
 147          - id
 148          - addrs
 149          - repo
 150          - spr
 151          - announceAddresses
 152          - table
 153          - codex
 154        properties:
 155          id:
 156            $ref: "#/components/schemas/PeerId"
 157          addrs:
 158            type: array
 159            items:
 160              $ref: "#/components/schemas/MultiAddress"
 161          repo:
 162            type: string
 163            description: Path of the data repository where all nodes data are stored
 164          spr:
 165            $ref: "#/components/schemas/SPR"
 166          announceAddresses:
 167            type: array
 168            items:
 169              $ref: "#/components/schemas/MultiAddress"
 170          table:
 171            $ref: "#/components/schemas/PeersTable"
 172          codex:
 173            $ref: "#/components/schemas/CodexVersion"
 174  
 175      SalesAvailability:
 176        type: object
 177        required:
 178          - totalSize
 179          - duration
 180          - minPricePerBytePerSecond
 181          - totalCollateral
 182        properties:
 183          totalSize:
 184            type: integer
 185            format: int64
 186            description: Total size of availability's storage in bytes
 187          duration:
 188            $ref: "#/components/schemas/Duration"
 189          minPricePerBytePerSecond:
 190            type: string
 191            description: Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string
 192          totalCollateral:
 193            type: string
 194            description: Total collateral (in amount of tokens) that can be used for matching requests
 195          enabled:
 196            type: boolean
 197            description: Enable the ability to receive sales on this availability.
 198            default: true
 199          until:
 200            type: integer
 201            description: Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.
 202            default: 0
 203  
 204      SalesAvailabilityREAD:
 205        required:
 206          - id
 207          - totalRemainingCollateral
 208          - freeSize
 209        allOf:
 210          - $ref: "#/components/schemas/SalesAvailability"
 211          - type: object
 212            properties:
 213              id:
 214                $ref: "#/components/schemas/Id"
 215                readonly: true
 216              freeSize:
 217                type: integer
 218                format: int64
 219                description: Unused size of availability's storage in bytes as decimal string
 220                readOnly: true
 221              totalRemainingCollateral:
 222                type: string
 223                description: Total collateral effective (in amount of tokens) that can be used for matching requests
 224                readOnly: true
 225  
 226      Slot:
 227        type: object
 228        required:
 229          - id
 230          - request
 231          - slotIndex
 232        properties:
 233          id:
 234            $ref: "#/components/schemas/SlotId"
 235          request:
 236            $ref: "#/components/schemas/StorageRequest"
 237          slotIndex:
 238            type: integer
 239            format: int64
 240            description: Slot Index number
 241  
 242      SlotAgent:
 243        type: object
 244        required:
 245          - state
 246          - requestId
 247          - slotIndex
 248        properties:
 249          slotIndex:
 250            type: integer
 251            format: int64
 252            description: Slot Index number
 253          requestId:
 254            $ref: "#/components/schemas/Id"
 255          request:
 256            $ref: "#/components/schemas/StorageRequest"
 257          reservation:
 258            $ref: "#/components/schemas/Reservation"
 259          state:
 260            type: string
 261            description: Description of the slot's
 262            enum:
 263              - SaleCancelled
 264              - SaleDownloading
 265              - SaleErrored
 266              - SaleFailed
 267              - SaleFilled
 268              - SaleFilling
 269              - SaleFinished
 270              - SaleIgnored
 271              - SaleInitialProving
 272              - SalePayout
 273              - SalePreparing
 274              - SaleProving
 275              - SaleUnknown
 276  
 277      Reservation:
 278        type: object
 279        required:
 280          - id
 281          - availabilityId
 282          - size
 283          - requestId
 284          - slotIndex
 285          - validUntil
 286        properties:
 287          id:
 288            $ref: "#/components/schemas/Id"
 289          availabilityId:
 290            $ref: "#/components/schemas/Id"
 291          size:
 292            type: integer
 293            format: int64
 294            description: Size of the slot in bytes
 295          requestId:
 296            $ref: "#/components/schemas/Id"
 297          slotIndex:
 298            type: integer
 299            format: int64
 300            description: Slot Index number
 301          validUntil:
 302            type: integer
 303            description: Timestamp after which the reservation will no longer be valid.
 304  
 305      StorageRequestCreation:
 306        type: object
 307        required:
 308          - pricePerBytePerSecond
 309          - duration
 310          - proofProbability
 311          - collateralPerByte
 312          - expiry
 313        properties:
 314          duration:
 315            $ref: "#/components/schemas/Duration"
 316          pricePerBytePerSecond:
 317            $ref: "#/components/schemas/PricePerBytePerSecond"
 318          proofProbability:
 319            $ref: "#/components/schemas/ProofProbability"
 320          nodes:
 321            description: Minimal number of nodes the content should be stored on
 322            type: integer
 323            default: 3
 324            minimum: 3
 325          tolerance:
 326            description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost
 327            type: integer
 328            default: 1
 329            minimum: 1
 330          collateralPerByte:
 331            $ref: "#/components/schemas/CollateralPerByte"
 332          expiry:
 333            type: integer
 334            format: int64
 335            description: Number that represents expiry threshold in seconds from when the Request is submitted. When the threshold is reached and the Request does not find requested amount of nodes to host the data, the Request is voided. The number of seconds can not be higher then the Request's duration itself.
 336      StorageAsk:
 337        type: object
 338        required:
 339          - slots
 340          - slotSize
 341          - duration
 342          - proofProbability
 343          - pricePerBytePerSecond
 344          - collateralPerByte
 345          - maxSlotLoss
 346        properties:
 347          slots:
 348            description: Number of slots (eq. hosts) that the Request want to have the content spread over
 349            type: integer
 350            format: int64
 351          slotSize:
 352            type: integer
 353            format: int64
 354            description: Amount of storage per slot in bytes
 355          duration:
 356            $ref: "#/components/schemas/Duration"
 357          proofProbability:
 358            $ref: "#/components/schemas/ProofProbability"
 359          pricePerBytePerSecond:
 360            $ref: "#/components/schemas/PricePerBytePerSecond"
 361          collateralPerByte:
 362            $ref: "#/components/schemas/CollateralPerByte"
 363          maxSlotLoss:
 364            type: integer
 365            format: int64
 366            description: Max slots that can be lost without data considered to be lost
 367  
 368      StorageRequest:
 369        type: object
 370        required:
 371          - id
 372          - client
 373          - ask
 374          - content
 375          - expiry
 376          - nonce
 377        properties:
 378          id:
 379            type: string
 380            description: Request ID
 381          client:
 382            $ref: "#/components/schemas/EthereumAddress"
 383          ask:
 384            $ref: "#/components/schemas/StorageAsk"
 385          content:
 386            $ref: "#/components/schemas/Content"
 387          expiry:
 388            $ref: "#/components/schemas/Expiry"
 389          nonce:
 390            type: string
 391            description: Random data
 392  
 393      Purchase:
 394        type: object
 395        required:
 396          - state
 397          - requestId
 398        properties:
 399          state:
 400            type: string
 401            description: Description of the Request's state
 402            enum:
 403              - cancelled
 404              - errored
 405              - failed
 406              - finished
 407              - pending
 408              - started
 409              - submitted
 410              - unknown
 411          error:
 412            type: string
 413            nullable: true
 414            description: If Request failed, then here is presented the error message
 415          request:
 416            $ref: "#/components/schemas/StorageRequest"
 417          requestId:
 418            $ref: "#/components/schemas/Id"
 419  
 420      DataList:
 421        type: object
 422        required:
 423          - content
 424        properties:
 425          content:
 426            type: array
 427            items:
 428              $ref: "#/components/schemas/DataItem"
 429  
 430      DataItem:
 431        type: object
 432        required:
 433          - cid
 434          - manifest
 435        properties:
 436          cid:
 437            $ref: "#/components/schemas/Cid"
 438          manifest:
 439            $ref: "#/components/schemas/ManifestItem"
 440  
 441      ManifestItem:
 442        type: object
 443        required:
 444          - treeCid
 445          - datasetSize
 446          - blockSize
 447          - protected
 448        properties:
 449          treeCid:
 450            $ref: "#/components/schemas/Cid"
 451            description: "Unique data identifier"
 452          datasetSize:
 453            type: integer
 454            format: int64
 455            description: "Length of original content in bytes"
 456          blockSize:
 457            type: integer
 458            description: "Size of blocks"
 459          protected:
 460            type: boolean
 461            description: "Indicates if content is protected by erasure-coding"
 462          filename:
 463            type: string
 464            nullable: true
 465            description: "The original name of the uploaded content (optional)"
 466            example: codex.png
 467          mimetype:
 468            type: string
 469            nullable: true
 470            description: "The original mimetype of the uploaded content (optional)"
 471            example: image/png
 472  
 473      Space:
 474        type: object
 475        required:
 476          - totalBlocks
 477          - quotaMaxBytes
 478          - quotaUsedBytes
 479          - quotaReservedBytes
 480        properties:
 481          totalBlocks:
 482            description: "Number of blocks stored by the node"
 483            type: integer
 484            format: int64
 485          quotaMaxBytes:
 486            type: integer
 487            format: int64
 488            description: "Maximum storage space (in bytes) available for the node in Codex's local repository."
 489          quotaUsedBytes:
 490            type: integer
 491            format: int64
 492            description: "Amount of storage space (in bytes) currently used for storing files in Codex's local repository."
 493          quotaReservedBytes:
 494            type: integer
 495            format: int64
 496            description: "Amount of storage reserved (in bytes) in the Codex's local repository for future use when storage requests will be picked up and hosted by the node using node's availabilities. This does not include the storage currently in use."
 497  
 498  servers:
 499    - url: "http://localhost:8080/api/codex/v1"
 500  
 501  tags:
 502    - name: Marketplace
 503      description: Marketplace information and operations
 504    - name: Data
 505      description: Data operations
 506    - name: Node
 507      description: Node management
 508    - name: Debug
 509      description: Debugging configuration
 510  
 511  paths:
 512    "/connect/{peerId}":
 513      get:
 514        summary: "Connect to a peer"
 515        description: |
 516          If `addrs` param is supplied, it will be used to dial the peer, otherwise the `peerId` is used
 517          to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
 518        tags: [Node]
 519        operationId: connectPeer
 520        parameters:
 521          - in: path
 522            name: peerId
 523            required: true
 524            schema:
 525              $ref: "#/components/schemas/PeerId"
 526            description: Peer that should be dialed.
 527          - in: query
 528            name: addrs
 529            schema:
 530              type: array
 531              nullable: true
 532              items:
 533                $ref: "#/components/schemas/MultiAddress"
 534            description: |
 535              If supplied, it will be used to dial the peer.
 536              The address has to target the listening address of the peer,
 537              which is specified with the `--listen-addrs` CLI flag.
 538  
 539        responses:
 540          "200":
 541            description: Successfully connected to peer
 542          "400":
 543            description: Peer either not found or was not possible to dial
 544  
 545    "/data":
 546      get:
 547        summary: "Lists manifest CIDs stored locally in node."
 548        tags: [Data]
 549        operationId: listData
 550        responses:
 551          "200":
 552            description: Retrieved list of content CIDs
 553            content:
 554              application/json:
 555                schema:
 556                  $ref: "#/components/schemas/DataList"
 557  
 558          "400":
 559            description: Invalid CID is specified
 560          "404":
 561            description: Content specified by the CID is not found
 562          "422":
 563            description: The content type is not a valid content type or the filename is not valid
 564          "500":
 565            description: Well it was bad-bad
 566      post:
 567        summary: "Upload a file in a streaming manner. Once finished, the file is stored in the node and can be retrieved by any node in the network using the returned CID."
 568        tags: [Data]
 569        operationId: upload
 570        parameters:
 571          - name: content-type
 572            in: header
 573            required: false
 574            description: The content type of the file. Must be valid.
 575            schema:
 576              type: string
 577              example: "image/png"
 578          - name: content-disposition
 579            in: header
 580            required: false
 581            description: The content disposition used to send the filename.
 582            schema:
 583              type: string
 584              example: 'attachment; filename="codex.png"'
 585        requestBody:
 586          content:
 587            application/octet-stream:
 588              schema:
 589                type: string
 590                format: binary
 591        responses:
 592          "200":
 593            description: CID of uploaded file
 594            content:
 595              text/plain:
 596                schema:
 597                  type: string
 598          "422":
 599            description: The mimetype of the filename is invalid
 600          "500":
 601            description: Well it was bad-bad and the upload did not work out
 602  
 603    "/data/{cid}":
 604      get:
 605        summary: "Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned."
 606        tags: [Data]
 607        operationId: downloadLocal
 608        parameters:
 609          - in: path
 610            name: cid
 611            required: true
 612            schema:
 613              $ref: "#/components/schemas/Cid"
 614            description: File to be downloaded.
 615  
 616        responses:
 617          "200":
 618            description: Retrieved content specified by CID
 619            content:
 620              application/octet-stream:
 621                schema:
 622                  type: string
 623                  format: binary
 624          "400":
 625            description: Invalid CID is specified
 626          "404":
 627            description: Content specified by the CID is unavailable locally
 628          "500":
 629            description: Well it was bad-bad
 630  
 631      delete:
 632        summary: "Deletes either a single block or an entire dataset from the local node."
 633        tags: [Data]
 634        operationId: deleteLocal
 635        parameters:
 636          - in: path
 637            name: cid
 638            required: true
 639            schema:
 640              $ref: "#/components/schemas/Cid"
 641            description: Block or dataset to be deleted.
 642  
 643        responses:
 644          "204":
 645            description: Data was successfully deleted.
 646          "400":
 647            description: Invalid CID is specified
 648          "500":
 649            description: There was an error during deletion
 650  
 651    "/data/{cid}/network":
 652      post:
 653        summary: "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed."
 654        tags: [Data]
 655        operationId: downloadNetwork
 656        parameters:
 657          - in: path
 658            name: cid
 659            required: true
 660            schema:
 661              $ref: "#/components/schemas/Cid"
 662            description: "File to be downloaded."
 663        responses:
 664          "200":
 665            description: Manifest information for download that has been started.
 666            content:
 667              application/json:
 668                schema:
 669                  $ref: "#/components/schemas/DataItem"
 670          "400":
 671            description: Invalid CID is specified
 672          "404":
 673            description: Failed to download dataset manifest
 674          "500":
 675            description: Well it was bad-bad
 676  
 677    "/data/{cid}/network/stream":
 678      get:
 679        summary: "Download a file from the network in a streaming manner. If the file is not available locally, it will be retrieved from other nodes in the network if able."
 680        tags: [Data]
 681        operationId: downloadNetworkStream
 682        parameters:
 683          - in: path
 684            name: cid
 685            required: true
 686            schema:
 687              $ref: "#/components/schemas/Cid"
 688            description: "File to be downloaded."
 689        responses:
 690          "200":
 691            description: Retrieved content specified by CID
 692            content:
 693              application/octet-stream:
 694                schema:
 695                  type: string
 696                  format: binary
 697          "400":
 698            description: Invalid CID is specified
 699          "404":
 700            description: Content specified by the CID is not found
 701          "500":
 702            description: Well it was bad-bad
 703  
 704    "/data/{cid}/network/manifest":
 705      get:
 706        summary: "Download only the dataset manifest from the network to the local node if it's not available locally."
 707        tags: [Data]
 708        operationId: downloadNetworkManifest
 709        parameters:
 710          - in: path
 711            name: cid
 712            required: true
 713            schema:
 714              $ref: "#/components/schemas/Cid"
 715            description: "File for which the manifest is to be downloaded."
 716        responses:
 717          "200":
 718            description: Manifest information.
 719            content:
 720              application/json:
 721                schema:
 722                  $ref: "#/components/schemas/DataItem"
 723          "400":
 724            description: Invalid CID is specified
 725          "404":
 726            description: Failed to download dataset manifest
 727          "500":
 728            description: Well it was bad-bad
 729  
 730    "/space":
 731      get:
 732        summary: "Gets a summary of the storage space allocation of the node."
 733        tags: [Data]
 734        operationId: space
 735        responses:
 736          "200":
 737            description: "Summary of storage allocation"
 738            content:
 739              application/json:
 740                schema:
 741                  $ref: "#/components/schemas/Space"
 742  
 743          "500":
 744            description: "It's not working as planned"
 745  
 746    "/sales/slots":
 747      get:
 748        summary: "Returns active slots"
 749        tags: [Marketplace]
 750        operationId: getActiveSlots
 751        responses:
 752          "200":
 753            description: Retrieved active slots
 754            content:
 755              application/json:
 756                schema:
 757                  type: array
 758                  items:
 759                    $ref: "#/components/schemas/Slot"
 760  
 761          "503":
 762            description: Persistence is not enabled
 763  
 764    "/sales/slots/{slotId}":
 765      get:
 766        summary: "Returns active slot with id {slotId} for the host"
 767        tags: [Marketplace]
 768        operationId: getActiveSlotById
 769        parameters:
 770          - in: path
 771            name: slotId
 772            required: true
 773            schema:
 774              $ref: "#/components/schemas/Cid"
 775            description: File to be downloaded.
 776        responses:
 777          "200":
 778            description: Retrieved active slot
 779            content:
 780              application/json:
 781                schema:
 782                  $ref: "#/components/schemas/SlotAgent"
 783  
 784          "400":
 785            description: Invalid or missing SlotId
 786  
 787          "404":
 788            description: Host is not in an active sale for the slot
 789  
 790          "503":
 791            description: Persistence is not enabled
 792  
 793    "/sales/availability":
 794      get:
 795        summary: "Returns storage that is for sale"
 796        tags: [Marketplace]
 797        operationId: getAvailabilities
 798        responses:
 799          "200":
 800            description: Retrieved storage availabilities of the node
 801            content:
 802              application/json:
 803                schema:
 804                  type: array
 805                  items:
 806                    $ref: "#/components/schemas/SalesAvailabilityREAD"
 807          "500":
 808            description: Error getting unused availabilities
 809          "503":
 810            description: Persistence is not enabled
 811  
 812      post:
 813        summary: "Offers storage for sale"
 814        operationId: offerStorage
 815        tags: [Marketplace]
 816        requestBody:
 817          content:
 818            application/json:
 819              schema:
 820                $ref: "#/components/schemas/SalesAvailability"
 821        responses:
 822          "201":
 823            description: Created storage availability
 824            content:
 825              application/json:
 826                schema:
 827                  $ref: "#/components/schemas/SalesAvailabilityREAD"
 828          "400":
 829            description: Invalid data input
 830          "422":
 831            description: Not enough node's storage quota available or the provided parameters did not pass validation
 832          "500":
 833            description: Error reserving availability
 834          "503":
 835            description: Persistence is not enabled
 836    "/sales/availability/{id}":
 837      patch:
 838        summary: "Updates availability"
 839        description: |
 840          The new parameters will be only considered for new requests.
 841          Existing Requests linked to this Availability will continue as is.
 842        operationId: updateOfferedStorage
 843        tags: [Marketplace]
 844        parameters:
 845          - in: path
 846            name: id
 847            required: true
 848            schema:
 849              type: string
 850            description: ID of Availability
 851        requestBody:
 852          content:
 853            application/json:
 854              schema:
 855                $ref: "#/components/schemas/SalesAvailability"
 856        responses:
 857          "204":
 858            description: Availability successfully updated
 859          "400":
 860            description: Invalid data input
 861          "404":
 862            description: Availability not found
 863          "422":
 864            description: The provided parameters did not pass validation
 865          "500":
 866            description: Error reserving availability
 867          "503":
 868            description: Persistence is not enabled
 869  
 870    "/sales/availability/{id}/reservations":
 871      get:
 872        summary: "Get availability's reservations"
 873        description: Return's list of Reservations for ongoing Storage Requests that the node hosts.
 874        operationId: getReservations
 875        tags: [Marketplace]
 876        parameters:
 877          - in: path
 878            name: id
 879            required: true
 880            schema:
 881              type: string
 882            description: ID of Availability
 883        responses:
 884          "200":
 885            description: Retrieved storage availabilities of the node
 886            content:
 887              application/json:
 888                schema:
 889                  type: array
 890                  items:
 891                    $ref: "#/components/schemas/Reservation"
 892          "400":
 893            description: Invalid Availability ID
 894          "404":
 895            description: Availability not found
 896          "500":
 897            description: Error getting reservations
 898          "503":
 899            description: Persistence is not enabled
 900  
 901    "/storage/request/{cid}":
 902      post:
 903        summary: "Creates a new Request for storage"
 904        tags: [Marketplace]
 905        operationId: createStorageRequest
 906        parameters:
 907          - in: path
 908            name: cid
 909            required: true
 910            schema:
 911              $ref: "#/components/schemas/Cid"
 912            description: CID of the uploaded data that should be stored
 913        requestBody:
 914          content:
 915            application/json:
 916              schema:
 917                $ref: "#/components/schemas/StorageRequestCreation"
 918        responses:
 919          "200":
 920            description: Returns the Request ID as decimal string
 921            content:
 922              text/plain:
 923                schema:
 924                  type: string
 925          "400":
 926            description: Invalid or missing Request ID
 927          "422":
 928            description: The storage request parameters are not valid
 929          "404":
 930            description: Request ID not found
 931          "503":
 932            description: Persistence is not enabled
 933  
 934    "/storage/purchases":
 935      get:
 936        summary: "Returns list of purchase IDs"
 937        tags: [Marketplace]
 938        operationId: getPurchases
 939        responses:
 940          "200":
 941            description: Gets all purchase IDs stored in node
 942            content:
 943              application/json:
 944                schema:
 945                  type: array
 946                  items:
 947                    type: string
 948          "503":
 949            description: Persistence is not enabled
 950  
 951    "/storage/purchases/{id}":
 952      get:
 953        summary: "Returns purchase details"
 954        tags: [Marketplace]
 955        operationId: getPurchase
 956        parameters:
 957          - in: path
 958            name: id
 959            required: true
 960            schema:
 961              type: string
 962            description: Hexadecimal ID of a Purchase
 963        responses:
 964          "200":
 965            description: Purchase details
 966            content:
 967              application/json:
 968                schema:
 969                  $ref: "#/components/schemas/Purchase"
 970          "400":
 971            description: Invalid or missing Purchase ID
 972          "404":
 973            description: Purchase not found
 974          "503":
 975            description: Persistence is not enabled
 976  
 977    "/spr":
 978      get:
 979        summary: "Get Node's SPR"
 980        operationId: getSPR
 981        tags: [Node]
 982        responses:
 983          "200":
 984            description: Node's SPR
 985            content:
 986              text/plain:
 987                schema:
 988                  $ref: "#/components/schemas/SPR"
 989              application/json:
 990                schema:
 991                  $ref: "#/components/schemas/SPRRead"
 992          "503":
 993            description: Node SPR not ready, try again later
 994  
 995    "/peerid":
 996      get:
 997        summary: "Get Node's PeerID"
 998        operationId: getPeerId
 999        tags: [Node]
1000        responses:
1001          "200":
1002            description: Node's Peer ID
1003            content:
1004              text/plain:
1005                schema:
1006                  $ref: "#/components/schemas/PeerId"
1007              application/json:
1008                schema:
1009                  $ref: "#/components/schemas/PeerIdRead"
1010  
1011    "/debug/chronicles/loglevel":
1012      post:
1013        summary: "Set log level at run time"
1014        tags: [Debug]
1015        operationId: setDebugLogLevel
1016  
1017        parameters:
1018          - in: query
1019            name: level
1020            required: true
1021            schema:
1022              $ref: "#/components/schemas/LogLevel"
1023  
1024        responses:
1025          "200":
1026            description: Successfully log level set
1027          "400":
1028            description: Invalid or missing log level
1029          "500":
1030            description: Well it was bad-bad
1031  
1032    "/debug/info":
1033      get:
1034        summary: "Gets node information"
1035        operationId: getDebugInfo
1036        tags: [Debug]
1037        responses:
1038          "200":
1039            description: Node's information
1040            content:
1041              application/json:
1042                schema:
1043                  $ref: "#/components/schemas/DebugInfo"