2024-08-23 16:22:29 +02:00
openapi : 3.0 .3
info :
version : 0.0 .1
title : Codex API
description : "List of endpoints and interfaces available to Codex API users"
security :
2025-03-26 16:42:46 +01:00
- {}
2024-08-23 16:22:29 +02:00
components :
schemas :
MultiAddress :
type : string
description : Address of node as specified by the multi-address specification https://multiformats.io/multiaddr/
example : /ip4/127.0.0.1/tcp/8080
PeerId :
type : string
description : Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/
example : QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
Id :
type : string
description : 32bits identifier encoded in hex-decimal string.
2024-08-25 14:41:02 +02:00
minLength : 66
maxLength : 66
2024-08-23 16:22:29 +02:00
example : 0x...
Cid :
type : string
description : Content Identifier as specified at https://github.com/multiformats/cid
example : QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
SlotId :
type : string
description : Keccak hash of the abi encoded tuple (RequestId, slot index)
example : 268a781e0db3f7cf36b18e5f4fdb7f586ec9edd08e5500b17c0e518a769f114a
LogLevel :
type : string
description : "One of the log levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL"
example : DEBUG
EthereumAddress :
type : string
description : Address of Ethereum address
2025-03-26 16:42:46 +01:00
PricePerBytePerSecond :
2024-08-23 16:22:29 +02:00
type : string
2025-03-26 16:42:46 +01:00
description : The amount of tokens paid per byte per second per slot to hosts the client is willing to pay
2024-08-23 16:22:29 +02:00
2025-04-23 10:59:04 +02:00
CollateralPerByte :
type : string
description : Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
2024-08-23 16:22:29 +02:00
Duration :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
description : The duration of the request in seconds
2024-08-23 16:22:29 +02:00
ProofProbability :
type : string
description : How often storage proofs are required as decimal string
Expiry :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
2024-08-23 16:22:29 +02:00
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.
SPR :
type : string
description : Signed Peer Record (libp2p)
SPRRead :
type : object
2025-04-23 10:59:04 +02:00
required :
- spr
2024-08-23 16:22:29 +02:00
properties :
spr :
$ref : "#/components/schemas/SPR"
PeerIdRead :
type : object
properties :
id :
$ref : "#/components/schemas/PeerId"
2024-12-18 14:22:21 +01:00
Content :
2024-08-23 16:22:29 +02:00
type : object
2025-04-23 10:59:04 +02:00
required :
- cid
2024-12-18 14:22:21 +01:00
description : Parameters specifying the content
2024-08-23 16:22:29 +02:00
properties :
2024-12-18 14:22:21 +01:00
cid :
$ref : "#/components/schemas/Cid"
2024-08-23 16:22:29 +02:00
2024-12-18 14:22:21 +01:00
Node :
2024-08-23 16:22:29 +02:00
type : object
2025-04-23 10:59:04 +02:00
required :
- nodeId
- peerId
- record
- address
- seen
2024-08-23 16:22:29 +02:00
properties :
2024-12-18 14:22:21 +01:00
nodeId :
2024-08-23 16:22:29 +02:00
type : string
2024-12-18 14:22:21 +01:00
peerId :
2024-08-23 16:22:29 +02:00
type : string
2024-12-18 14:22:21 +01:00
record :
2024-08-23 16:22:29 +02:00
type : string
2024-12-18 14:22:21 +01:00
address :
type : string
seen :
type : boolean
2024-08-23 16:22:29 +02:00
2024-12-18 14:22:21 +01:00
CodexVersion :
2024-08-23 16:22:29 +02:00
type : object
properties :
2024-12-18 14:22:21 +01:00
version :
type : string
example : v0.1.7
revision :
type : string
example : 0c647d8
2025-04-23 10:59:04 +02:00
contracts :
type : string
example : 0b537c7
2024-12-18 14:22:21 +01:00
PeersTable :
type : object
2025-04-23 10:59:04 +02:00
required :
- localNode
- nodes
2024-12-18 14:22:21 +01:00
properties :
localNode :
$ref : "#/components/schemas/Node"
nodes :
type : array
items :
$ref : "#/components/schemas/Node"
2024-08-23 16:22:29 +02:00
DebugInfo :
type : object
2025-04-23 10:59:04 +02:00
required :
- id
- addrs
- repo
- spr
- announceAddresses
- table
- codex
2024-08-23 16:22:29 +02:00
properties :
id :
$ref : "#/components/schemas/PeerId"
addrs :
type : array
items :
$ref : "#/components/schemas/MultiAddress"
repo :
type : string
description : Path of the data repository where all nodes data are stored
spr :
$ref : "#/components/schemas/SPR"
2025-03-26 16:42:46 +01:00
announceAddresses :
type : array
items :
$ref : "#/components/schemas/MultiAddress"
2024-12-18 14:22:21 +01:00
table :
$ref : "#/components/schemas/PeersTable"
codex :
$ref : "#/components/schemas/CodexVersion"
2024-08-23 16:22:29 +02:00
SalesAvailability :
type : object
2025-04-23 10:59:04 +02:00
required :
- totalSize
- duration
- minPricePerBytePerSecond
- totalCollateral
2024-08-23 16:22:29 +02:00
properties :
totalSize :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
description : Total size of availability's storage in bytes
2024-08-23 16:22:29 +02:00
duration :
$ref : "#/components/schemas/Duration"
2025-03-26 16:42:46 +01:00
minPricePerBytePerSecond :
2024-08-23 16:22:29 +02:00
type : string
2025-03-26 16:42:46 +01:00
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
totalCollateral :
2024-08-23 16:22:29 +02:00
type : string
2025-03-26 16:42:46 +01:00
description : Total collateral (in amount of tokens) that can be used for matching requests
2025-04-23 10:59:04 +02:00
enabled :
type : boolean
description : Enable the ability to receive sales on this availability.
default : true
until :
type : integer
description : Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.
default : 0
2024-08-23 16:22:29 +02:00
SalesAvailabilityREAD :
2025-04-23 10:59:04 +02:00
required :
- id
- totalRemainingCollateral
2025-05-22 08:35:56 +02:00
- freeSize
2024-08-23 16:22:29 +02:00
allOf :
- $ref : "#/components/schemas/SalesAvailability"
- type : object
properties :
2025-04-23 10:59:04 +02:00
id :
$ref : "#/components/schemas/Id"
readonly : true
2024-08-23 16:22:29 +02:00
freeSize :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
2025-04-23 10:59:04 +02:00
description : Unused size of availability's storage in bytes as decimal string
readOnly : true
totalRemainingCollateral :
type : string
description : Total collateral effective (in amount of tokens) that can be used for matching requests
readOnly : true
2024-08-23 16:22:29 +02:00
Slot :
type : object
2025-04-23 10:59:04 +02:00
required :
- id
- request
- slotIndex
2024-08-23 16:22:29 +02:00
properties :
id :
$ref : "#/components/schemas/SlotId"
request :
$ref : "#/components/schemas/StorageRequest"
slotIndex :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
description : Slot Index number
2024-08-25 14:41:02 +02:00
SlotAgent :
type : object
2025-04-23 10:59:04 +02:00
required :
- state
- requestId
- slotIndex
2024-08-25 14:41:02 +02:00
properties :
slotIndex :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
description : Slot Index number
2024-08-25 14:41:02 +02:00
requestId :
$ref : "#/components/schemas/Id"
request :
$ref : "#/components/schemas/StorageRequest"
reservation :
$ref : "#/components/schemas/Reservation"
state :
type : string
description : Description of the slot's
enum :
- SaleCancelled
- SaleDownloading
- SaleErrored
- SaleFailed
- SaleFilled
- SaleFilling
- SaleFinished
- SaleIgnored
- SaleInitialProving
- SalePayout
- SalePreparing
- SaleProving
- SaleUnknown
2024-08-23 16:22:29 +02:00
Reservation :
type : object
2025-04-23 10:59:04 +02:00
required :
- id
- availabilityId
- size
- requestId
- slotIndex
- validUntil
2024-08-23 16:22:29 +02:00
properties :
id :
$ref : "#/components/schemas/Id"
availabilityId :
$ref : "#/components/schemas/Id"
size :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
description : Size of the slot in bytes
2024-08-23 16:22:29 +02:00
requestId :
$ref : "#/components/schemas/Id"
slotIndex :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
description : Slot Index number
2025-04-23 10:59:04 +02:00
validUntil :
type : integer
description : Timestamp after which the reservation will no longer be valid.
2024-08-23 16:22:29 +02:00
StorageRequestCreation :
type : object
required :
2025-03-26 16:42:46 +01:00
- pricePerBytePerSecond
2024-08-23 16:22:29 +02:00
- duration
- proofProbability
2025-03-26 16:42:46 +01:00
- collateralPerByte
2024-08-23 16:22:29 +02:00
- expiry
properties :
duration :
$ref : "#/components/schemas/Duration"
2025-03-26 16:42:46 +01:00
pricePerBytePerSecond :
$ref : "#/components/schemas/PricePerBytePerSecond"
2024-08-23 16:22:29 +02:00
proofProbability :
$ref : "#/components/schemas/ProofProbability"
nodes :
description : Minimal number of nodes the content should be stored on
type : integer
2025-03-31 17:52:10 +02:00
default : 3
2025-03-31 18:47:51 +02:00
minimum : 3
2024-08-23 16:22:29 +02:00
tolerance :
description : Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost
type : integer
2025-03-31 17:52:10 +02:00
default : 1
2025-03-31 18:47:51 +02:00
minimum : 1
2025-03-26 16:42:46 +01:00
collateralPerByte :
2025-04-23 10:59:04 +02:00
$ref : "#/components/schemas/CollateralPerByte"
2024-08-23 16:22:29 +02:00
expiry :
2025-03-31 17:52:10 +02:00
type : integer
format : int64
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.
2024-08-23 16:22:29 +02:00
StorageAsk :
type : object
required :
2025-04-23 10:59:04 +02:00
- slots
- slotSize
- duration
- proofProbability
2025-03-26 16:42:46 +01:00
- pricePerBytePerSecond
2025-04-23 10:59:04 +02:00
- collateralPerByte
- maxSlotLoss
2024-08-23 16:22:29 +02:00
properties :
slots :
description : Number of slots (eq. hosts) that the Request want to have the content spread over
type : integer
2025-03-31 18:47:51 +02:00
format : int64
2024-08-23 16:22:29 +02:00
slotSize :
2025-03-31 18:47:51 +02:00
type : integer
format : int64
2025-04-23 10:59:04 +02:00
description : Amount of storage per slot in bytes
2024-08-23 16:22:29 +02:00
duration :
$ref : "#/components/schemas/Duration"
proofProbability :
$ref : "#/components/schemas/ProofProbability"
2025-03-26 16:42:46 +01:00
pricePerBytePerSecond :
$ref : "#/components/schemas/PricePerBytePerSecond"
2025-04-23 10:59:04 +02:00
collateralPerByte :
$ref : "#/components/schemas/CollateralPerByte"
2024-08-23 16:22:29 +02:00
maxSlotLoss :
type : integer
2025-03-31 18:47:51 +02:00
format : int64
2024-08-23 16:22:29 +02:00
description : Max slots that can be lost without data considered to be lost
StorageRequest :
type : object
2025-04-23 10:59:04 +02:00
required :
- id
- client
- ask
- content
- expiry
- nonce
2024-08-23 16:22:29 +02:00
properties :
id :
type : string
description : Request ID
client :
$ref : "#/components/schemas/EthereumAddress"
ask :
$ref : "#/components/schemas/StorageAsk"
content :
$ref : "#/components/schemas/Content"
expiry :
$ref : "#/components/schemas/Expiry"
nonce :
type : string
description : Random data
Purchase :
type : object
2025-04-23 10:59:04 +02:00
required :
- state
- requestId
2024-08-23 16:22:29 +02:00
properties :
state :
type : string
description : Description of the Request's state
2024-08-24 23:45:27 +02:00
enum :
2024-08-25 21:03:33 +02:00
- cancelled
2025-04-23 10:59:04 +02:00
- errored
2024-08-25 21:03:33 +02:00
- failed
- finished
- pending
- started
- submitted
- unknown
2024-08-23 16:22:29 +02:00
error :
type : string
2025-04-23 10:59:04 +02:00
nullable : true
2024-08-23 16:22:29 +02:00
description : If Request failed, then here is presented the error message
request :
$ref : "#/components/schemas/StorageRequest"
2025-04-23 10:59:04 +02:00
requestId :
$ref : "#/components/schemas/Id"
2024-08-23 16:22:29 +02:00
DataList :
type : object
2025-04-23 10:59:04 +02:00
required :
- content
2024-08-23 16:22:29 +02:00
properties :
content :
type : array
items :
$ref : "#/components/schemas/DataItem"
DataItem :
type : object
2025-04-23 10:59:04 +02:00
required :
- cid
- manifest
2024-08-23 16:22:29 +02:00
properties :
cid :
$ref : "#/components/schemas/Cid"
manifest :
$ref : "#/components/schemas/ManifestItem"
ManifestItem :
type : object
2025-04-23 10:59:04 +02:00
required :
- treeCid
- datasetSize
- blockSize
- protected
2024-08-23 16:22:29 +02:00
properties :
2024-12-18 14:22:21 +01:00
treeCid :
2024-08-23 16:22:29 +02:00
$ref : "#/components/schemas/Cid"
2024-12-18 14:22:21 +01:00
description : "Unique data identifier"
datasetSize :
2024-08-23 16:22:29 +02:00
type : integer
format : int64
description : "Length of original content in bytes"
blockSize :
type : integer
description : "Size of blocks"
protected :
type : boolean
description : "Indicates if content is protected by erasure-coding"
2024-12-18 14:22:21 +01:00
filename :
type : string
nullable : true
description : "The original name of the uploaded content (optional)"
example : codex.png
mimetype :
type : string
nullable : true
description : "The original mimetype of the uploaded content (optional)"
example : image/png
2024-08-23 16:22:29 +02:00
Space :
type : object
2025-04-23 10:59:04 +02:00
required :
- totalBlocks
- quotaMaxBytes
- quotaUsedBytes
- quotaReservedBytes
2024-08-23 16:22:29 +02:00
properties :
totalBlocks :
description : "Number of blocks stored by the node"
type : integer
format : int64
quotaMaxBytes :
type : integer
format : int64
2024-12-18 14:22:21 +01:00
description : "Maximum storage space (in bytes) available for the node in Codex's local repository."
2024-08-23 16:22:29 +02:00
quotaUsedBytes :
type : integer
format : int64
2024-12-18 14:22:21 +01:00
description : "Amount of storage space (in bytes) currently used for storing files in Codex's local repository."
2024-08-23 16:22:29 +02:00
quotaReservedBytes :
type : integer
format : int64
2024-12-18 14:22:21 +01:00
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."
2024-08-23 16:22:29 +02:00
servers :
- url : "http://localhost:8080/api/codex/v1"
tags :
- name : Marketplace
description : Marketplace information and operations
- name : Data
description : Data operations
- name : Node
description : Node management
- name : Debug
description : Debugging configuration
paths :
"/connect/{peerId}" :
get :
summary : "Connect to a peer"
description : |
If `addrs` param is supplied, it will be used to dial the peer, otherwise the `peerId` is used
to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
2025-03-26 16:42:46 +01:00
tags : [ Node]
2024-08-23 16:22:29 +02:00
operationId : connectPeer
parameters :
- in : path
name : peerId
required : true
schema :
2024-08-24 23:45:27 +02:00
$ref : "#/components/schemas/PeerId"
2024-08-23 16:22:29 +02:00
description : Peer that should be dialed.
- in : query
name : addrs
schema :
type : array
nullable : true
items :
$ref : "#/components/schemas/MultiAddress"
description : |
If supplied, it will be used to dial the peer.
The address has to target the listening address of the peer,
which is specified with the `--listen-addrs` CLI flag.
responses :
"200" :
description : Successfully connected to peer
"400" :
description : Peer either not found or was not possible to dial
"/data" :
get :
summary : "Lists manifest CIDs stored locally in node."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-08-23 16:22:29 +02:00
operationId : listData
responses :
"200" :
description : Retrieved list of content CIDs
content :
application/json :
schema :
$ref : "#/components/schemas/DataList"
"400" :
description : Invalid CID is specified
"404" :
description : Content specified by the CID is not found
2024-12-18 14:22:21 +01:00
"422" :
description : The content type is not a valid content type or the filename is not valid
2024-08-23 16:22:29 +02:00
"500" :
description : Well it was bad-bad
post :
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."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-08-23 16:22:29 +02:00
operationId : upload
2024-12-18 14:22:21 +01:00
parameters :
- name : content-type
in : header
required : false
description : The content type of the file. Must be valid.
schema :
type : string
example : "image/png"
- name : content-disposition
in : header
required : false
description : The content disposition used to send the filename.
schema :
type : string
2025-03-26 16:42:46 +01:00
example : 'attachment; filename="codex.png"'
2024-08-23 16:22:29 +02:00
requestBody :
content :
application/octet-stream :
schema :
type : string
format : binary
responses :
"200" :
description : CID of uploaded file
content :
text/plain :
schema :
type : string
2025-04-23 10:59:04 +02:00
"422" :
description : The mimetype of the filename is invalid
2024-08-23 16:22:29 +02:00
"500" :
description : Well it was bad-bad and the upload did not work out
"/data/{cid}" :
get :
summary : "Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-08-23 16:22:29 +02:00
operationId : downloadLocal
parameters :
- in : path
name : cid
required : true
schema :
2024-08-24 23:45:27 +02:00
$ref : "#/components/schemas/Cid"
2024-08-23 16:22:29 +02:00
description : File to be downloaded.
responses :
"200" :
description : Retrieved content specified by CID
content :
application/octet-stream :
schema :
type : string
format : binary
"400" :
description : Invalid CID is specified
"404" :
description : Content specified by the CID is unavailable locally
"500" :
description : Well it was bad-bad
2025-05-22 08:35:56 +02:00
delete :
summary : "Deletes either a single block or an entire dataset from the local node."
tags : [ Data]
operationId : deleteLocal
parameters :
- in : path
name : cid
required : true
schema :
$ref : "#/components/schemas/Cid"
description : Block or dataset to be deleted.
responses :
"204" :
description : Data was successfully deleted.
"400" :
description : Invalid CID is specified
"500" :
description : There was an error during deletion
2024-08-23 16:22:29 +02:00
"/data/{cid}/network" :
2024-12-18 14:22:21 +01:00
post :
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."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-12-18 14:22:21 +01:00
operationId : downloadNetwork
parameters :
- in : path
name : cid
required : true
schema :
$ref : "#/components/schemas/Cid"
description : "File to be downloaded."
responses :
"200" :
description : Manifest information for download that has been started.
content :
application/json :
schema :
$ref : "#/components/schemas/DataItem"
"400" :
description : Invalid CID is specified
"404" :
description : Failed to download dataset manifest
"500" :
description : Well it was bad-bad
"/data/{cid}/network/stream" :
2024-08-23 16:22:29 +02:00
get :
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."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-12-18 14:22:21 +01:00
operationId : downloadNetworkStream
2024-08-23 16:22:29 +02:00
parameters :
- in : path
name : cid
required : true
schema :
2024-08-24 23:45:27 +02:00
$ref : "#/components/schemas/Cid"
2024-08-23 16:22:29 +02:00
description : "File to be downloaded."
responses :
"200" :
description : Retrieved content specified by CID
content :
application/octet-stream :
schema :
type : string
format : binary
"400" :
description : Invalid CID is specified
"404" :
description : Content specified by the CID is not found
"500" :
description : Well it was bad-bad
2024-12-18 14:22:21 +01:00
"/data/{cid}/network/manifest" :
get :
summary : "Download only the dataset manifest from the network to the local node if it's not available locally."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-12-18 14:22:21 +01:00
operationId : downloadNetworkManifest
parameters :
- in : path
name : cid
required : true
schema :
$ref : "#/components/schemas/Cid"
description : "File for which the manifest is to be downloaded."
responses :
"200" :
description : Manifest information.
content :
application/json :
schema :
$ref : "#/components/schemas/DataItem"
"400" :
description : Invalid CID is specified
"404" :
description : Failed to download dataset manifest
"500" :
description : Well it was bad-bad
2024-08-23 16:22:29 +02:00
"/space" :
get :
summary : "Gets a summary of the storage space allocation of the node."
2025-03-26 16:42:46 +01:00
tags : [ Data]
2024-08-23 16:22:29 +02:00
operationId : space
responses :
"200" :
description : "Summary of storage allocation"
content :
application/json :
schema :
$ref : "#/components/schemas/Space"
"500" :
description : "It's not working as planned"
"/sales/slots" :
get :
summary : "Returns active slots"
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
operationId : getActiveSlots
responses :
"200" :
description : Retrieved active slots
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/Slot"
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/sales/slots/{slotId}" :
get :
summary : "Returns active slot with id {slotId} for the host"
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
operationId : getActiveSlotById
parameters :
- in : path
name : slotId
required : true
schema :
$ref : "#/components/schemas/Cid"
description : File to be downloaded.
responses :
"200" :
description : Retrieved active slot
content :
application/json :
schema :
2024-08-25 14:41:02 +02:00
$ref : "#/components/schemas/SlotAgent"
2024-08-23 16:22:29 +02:00
"400" :
description : Invalid or missing SlotId
"404" :
description : Host is not in an active sale for the slot
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/sales/availability" :
get :
summary : "Returns storage that is for sale"
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-25 14:49:56 +02:00
operationId : getAvailabilities
2024-08-23 16:22:29 +02:00
responses :
"200" :
description : Retrieved storage availabilities of the node
content :
application/json :
schema :
type : array
items :
2024-08-25 15:04:31 +02:00
$ref : "#/components/schemas/SalesAvailabilityREAD"
2024-08-23 16:22:29 +02:00
"500" :
description : Error getting unused availabilities
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
post :
summary : "Offers storage for sale"
operationId : offerStorage
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
requestBody :
content :
application/json :
schema :
2025-04-23 10:59:04 +02:00
$ref : "#/components/schemas/SalesAvailability"
2024-08-23 16:22:29 +02:00
responses :
"201" :
description : Created storage availability
content :
application/json :
schema :
$ref : "#/components/schemas/SalesAvailabilityREAD"
"400" :
description : Invalid data input
"422" :
2025-04-23 10:59:04 +02:00
description : Not enough node's storage quota available or the provided parameters did not pass validation
2024-08-23 16:22:29 +02:00
"500" :
description : Error reserving availability
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/sales/availability/{id}" :
patch :
summary : "Updates availability"
description : |
The new parameters will be only considered for new requests.
Existing Requests linked to this Availability will continue as is.
operationId : updateOfferedStorage
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
parameters :
- in : path
name : id
required : true
schema :
type : string
description : ID of Availability
requestBody :
content :
application/json :
schema :
$ref : "#/components/schemas/SalesAvailability"
responses :
"204" :
description : Availability successfully updated
"400" :
description : Invalid data input
"404" :
description : Availability not found
"422" :
2025-04-23 10:59:04 +02:00
description : The provided parameters did not pass validation
2024-08-23 16:22:29 +02:00
"500" :
description : Error reserving availability
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/sales/availability/{id}/reservations" :
2024-08-24 23:45:27 +02:00
get :
2024-08-23 16:22:29 +02:00
summary : "Get availability's reservations"
description : Return's list of Reservations for ongoing Storage Requests that the node hosts.
operationId : getReservations
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
parameters :
- in : path
name : id
required : true
schema :
type : string
description : ID of Availability
responses :
"200" :
description : Retrieved storage availabilities of the node
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/Reservation"
"400" :
description : Invalid Availability ID
"404" :
description : Availability not found
"500" :
description : Error getting reservations
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/storage/request/{cid}" :
post :
summary : "Creates a new Request for storage"
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
operationId : createStorageRequest
parameters :
- in : path
name : cid
required : true
schema :
$ref : "#/components/schemas/Cid"
description : CID of the uploaded data that should be stored
requestBody :
content :
application/json :
schema :
$ref : "#/components/schemas/StorageRequestCreation"
responses :
"200" :
description : Returns the Request ID as decimal string
content :
text/plain :
schema :
type : string
"400" :
description : Invalid or missing Request ID
2025-04-23 10:59:04 +02:00
"422" :
description : The storage request parameters are not valid
2024-08-23 16:22:29 +02:00
"404" :
description : Request ID not found
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/storage/purchases" :
get :
summary : "Returns list of purchase IDs"
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
operationId : getPurchases
responses :
"200" :
description : Gets all purchase IDs stored in node
content :
application/json :
schema :
type : array
items :
type : string
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
"/storage/purchases/{id}" :
get :
summary : "Returns purchase details"
2025-03-26 16:42:46 +01:00
tags : [ Marketplace]
2024-08-23 16:22:29 +02:00
operationId : getPurchase
parameters :
- in : path
name : id
required : true
schema :
type : string
description : Hexadecimal ID of a Purchase
responses :
"200" :
description : Purchase details
content :
application/json :
schema :
$ref : "#/components/schemas/Purchase"
"400" :
description : Invalid or missing Purchase ID
"404" :
description : Purchase not found
"503" :
2024-08-25 14:41:02 +02:00
description : Persistence is not enabled
2024-08-23 16:22:29 +02:00
2024-12-18 14:22:21 +01:00
"/spr" :
2024-08-23 16:22:29 +02:00
get :
summary : "Get Node's SPR"
operationId : getSPR
2025-03-26 16:42:46 +01:00
tags : [ Node]
2024-08-23 16:22:29 +02:00
responses :
"200" :
description : Node's SPR
content :
2025-04-23 10:59:04 +02:00
text/plain :
2024-08-23 16:22:29 +02:00
schema :
$ref : "#/components/schemas/SPR"
application/json :
schema :
$ref : "#/components/schemas/SPRRead"
"503" :
description : Node SPR not ready, try again later
2024-12-18 14:22:21 +01:00
"/peerid" :
2024-08-23 16:22:29 +02:00
get :
summary : "Get Node's PeerID"
operationId : getPeerId
2025-03-26 16:42:46 +01:00
tags : [ Node]
2024-08-23 16:22:29 +02:00
responses :
"200" :
description : Node's Peer ID
content :
2025-04-23 10:59:04 +02:00
text/plain :
2024-08-23 16:22:29 +02:00
schema :
$ref : "#/components/schemas/PeerId"
application/json :
schema :
$ref : "#/components/schemas/PeerIdRead"
"/debug/chronicles/loglevel" :
post :
summary : "Set log level at run time"
2025-03-26 16:42:46 +01:00
tags : [ Debug]
2024-08-23 16:22:29 +02:00
operationId : setDebugLogLevel
parameters :
- in : query
name : level
required : true
schema :
$ref : "#/components/schemas/LogLevel"
responses :
"200" :
description : Successfully log level set
"400" :
description : Invalid or missing log level
"500" :
description : Well it was bad-bad
"/debug/info" :
get :
summary : "Gets node information"
operationId : getDebugInfo
2025-03-26 16:42:46 +01:00
tags : [ Debug]
2024-08-23 16:22:29 +02:00
responses :
"200" :
description : Node's information
content :
application/json :
schema :
$ref : "#/components/schemas/DebugInfo"