Upload and Pin file or folder to IPFS
Authorizations:
Request Body schema: multipart/form-data
file | string <binary> File(s) to upload |
object (PinMeta) Optional metadata for pin object | |
name | string <= 255 characters Optional name for pinned data; can be used for lookups later |
wrapWithDirectory | boolean |
Responses
Response samples
- 200
{- "code": 200,
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "cid": "string",
- "name": "string",
- "size": 0
}
Create an upload token that allows the holder to upload content to IPFS. Restrictions available.
An upload token can be passed as a header to the upload call on Zeet-managed IPFS nodes. An upload token can have restrictions baked into it at creation time, such as:
- number of times the upload token can be used
- max file size the user is allowed to upload with this token
- how long after upload token creation time is this token valid for
Authorizations:
Request Body schema: application/json
expiresIn | integer <int32> Seconds until this token is invalidated |
maxFileSize | integer <int64> Max file size (in bytes) to allow |
maxUsages | integer <int32> The number of times this upload token can be used |
Responses
Request samples
- Payload
{- "expiresIn": 1,
- "maxFileSize": 6,
- "maxUsages": 0
}
Response samples
- 200
{- "code": 200,
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "token": "pa$$word"
}
Get the associated metadata for a given CID or CIDs.
Authorizations:
query Parameters
cids required | Array of strings <cid> A coma-seperated list of the CIDs of the files whose metadata should be fetched. |
Responses
Response samples
- 200
{- "code": 200,
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "data": [
- {
- "cid": "string",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "string"
}
]
}
Attach metadata to a given CID
Authorizations:
Request Body schema: application/json
cid required | string <cid> The CID of the file to attach metadata to. |
object (PinMeta) Optional metadata for pin object | |
name | string |
Responses
Request samples
- Payload
{- "cid": "QmTDMoVqvyBkNMRhzvukTDznntByUNDwyNdSfV8dZ3VKRC",
- "meta": {
- "foo": "bar"
}, - "name": "file.jpg"
}
Response samples
- 200
{- "code": 200,
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "cid": "string",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "string"
}
Used to update existing metadata for a given CID
Used to update existing metadata for a given CID. Metadata overwritten existing metadata for the CID. If no existing metadata is present, updateMetadata acts the same as an attachMetadata call.
Authorizations:
Request Body schema: application/json
cid required | string <cid> The CID of the file to update the metadata of. |
object (PinMeta) Optional metadata for pin object | |
name | string |
Responses
Request samples
- Payload
{- "cid": "QmTDMoVqvyBkNMRhzvukTDznntByUNDwyNdSfV8dZ3VKRC",
- "meta": {
- "foo": "bar"
}, - "name": "image.jpg"
}
Response samples
- 200
{- "code": 200,
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "cid": "string",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "string"
}
Detach any previously attached metadata from the given CID.
Detach any previously attached metadata from the given CID. If the CID is not found, or there is no metadata to detach, detachMetadata returns a successful response.
Authorizations:
path Parameters
cid required | string <cid> The CID to remove the metadata from |
Responses
Response samples
- 200
{- "code": 200,
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "cid": "string"
}
List pin objects
List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned
Authorizations:
query Parameters
after | string <date-time> Example: after=2020-07-27T17:32:28Z Return results created (queued) after provided timestamp |
before | string <date-time> Example: before=2020-07-27T17:32:28Z Return results created (queued) before provided timestamp |
cid | Array of strings [ 1 .. 10 ] items unique Example: cid=Qm1,Qm2,bafy3 Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts |
limit | integer <int32> [ 1 .. 1000 ] Default: 10 Max records to return |
match | string (TextMatchingStrategy) Default: "exact" Enum: "exact" "iexact" "partial" "ipartial" Example: match=exact Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies |
object (PinMeta) Example: meta={"app_id":"99986338-1113-4706-8302-4420da6158aa"} Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport | |
name | string <= 255 characters Example: name=PreciousData.pdf Return pin objects with specified name (by default a case-sensitive, exact match) |
status | Array of strings (Status) non-empty unique Items Enum: "uploading" "queued" "pinning" "pinned" "failed" Example: status=queued,pinning Return pin objects for pins with the specified status |
Responses
Response samples
- 200
- 400
- 401
- 404
- 409
- 4XX
- 5XX
{- "count": 1,
- "results": [
- {
- "created": "2020-07-27T17:32:28Z",
- "delegates": [
- "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId"
], - "info": {
- "status_details": "Queue position: 7 of 9"
}, - "pin": {
- "cid": "QmCIDToBePinned",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "PreciousData.pdf",
- "origins": [
- "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId",
- "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId"
]
}, - "requestid": "UniqueIdOfPinRequest",
- "status": "uploading",
- "updated": "2020-07-27T17:32:28Z"
}
]
}
Add pin object
Add a new pin object for the current access token
Authorizations:
Request Body schema: application/json
cid required | string Content Identifier (CID) to be pinned recursively |
object (PinMeta) Optional metadata for pin object | |
name | string <= 255 characters Optional name for pinned data; can be used for lookups later |
origins | Array of strings (Origins) <= 20 items unique Optional list of multiaddrs known to provide the data |
Responses
Request samples
- Payload
{- "cid": "QmCIDToBePinned",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "PreciousData.pdf",
- "origins": [
- "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId",
- "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId"
]
}
Response samples
- 202
- 400
- 401
- 404
- 409
- 4XX
- 5XX
{- "created": "2020-07-27T17:32:28Z",
- "delegates": [
- "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId"
], - "info": {
- "status_details": "Queue position: 7 of 9"
}, - "pin": {
- "cid": "QmCIDToBePinned",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "PreciousData.pdf",
- "origins": [
- "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId",
- "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId"
]
}, - "requestid": "UniqueIdOfPinRequest",
- "status": "uploading",
- "updated": "2020-07-27T17:32:28Z"
}
Get pin object
Get a pin object and its status
Authorizations:
path Parameters
requestid required | string |
Responses
Response samples
- 200
- 400
- 401
- 404
- 409
- 4XX
- 5XX
{- "created": "2020-07-27T17:32:28Z",
- "delegates": [
- "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId"
], - "info": {
- "status_details": "Queue position: 7 of 9"
}, - "pin": {
- "cid": "QmCIDToBePinned",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "PreciousData.pdf",
- "origins": [
- "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId",
- "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId"
]
}, - "requestid": "UniqueIdOfPinRequest",
- "status": "uploading",
- "updated": "2020-07-27T17:32:28Z"
}
Replace pin object
Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins)
Authorizations:
path Parameters
requestid required | string |
Request Body schema: application/json
cid required | string Content Identifier (CID) to be pinned recursively |
object (PinMeta) Optional metadata for pin object | |
name | string <= 255 characters Optional name for pinned data; can be used for lookups later |
origins | Array of strings (Origins) <= 20 items unique Optional list of multiaddrs known to provide the data |
Responses
Request samples
- Payload
{- "cid": "QmCIDToBePinned",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "PreciousData.pdf",
- "origins": [
- "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId",
- "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId"
]
}
Response samples
- 202
- 400
- 401
- 404
- 409
- 4XX
- 5XX
{- "created": "2020-07-27T17:32:28Z",
- "delegates": [
- "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId"
], - "info": {
- "status_details": "Queue position: 7 of 9"
}, - "pin": {
- "cid": "QmCIDToBePinned",
- "meta": {
- "app_id": "99986338-1113-4706-8302-4420da6158aa"
}, - "name": "PreciousData.pdf",
- "origins": [
- "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId",
- "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId"
]
}, - "requestid": "UniqueIdOfPinRequest",
- "status": "uploading",
- "updated": "2020-07-27T17:32:28Z"
}