Swarm API (0.5.1)

Download OpenAPI specification:Download

A list of the currently provided Interfaces to interact with the swarm, implementing file operations and sending messages

Bytes

Upload data

Authorizations:
header Parameters
swarm-tag
integer

Associate upload with an existing Tag UID

swarm-pin
boolean

Represents the pinning state of the chunk

swarm-encrypt
boolean

Represents the encrypting state of the file

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Get referenced data

Authorizations:
path Parameters
required
string or string or string

Swarm address reference to content

Responses

Response samples

Content type
application/problem+json
"string"

Chunk

Get Chunk

Authorizations:
path Parameters
required
string or string or string

Swarm address of chunk

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

Upload Chunk

Authorizations:
header Parameters
swarm-tag
integer

Associate upload with an existing Tag UID

swarm-pin
boolean

Represents the pinning state of the chunk

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "string"
}

File

Upload file

Authorizations:
query Parameters
name
string

Filename

header Parameters
swarm-tag
integer

Associate upload with an existing Tag UID

swarm-pin
boolean

Represents the pinning state of the chunk

swarm-encrypt
boolean

Represents the encrypting state of the file

Content-Type
string

The specified content-type is preserved for download of the asset

Request Body schema:
file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Get referenced file

Authorizations:
path Parameters
required
string or string or string

Swarm address of content

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

Collection

Upload a collection

Authorizations:
header Parameters
swarm-tag
integer

Associate upload with an existing Tag UID

swarm-pin
boolean

Represents the pinning state of the chunk

swarm-encrypt
boolean

Represents the encrypting state of the file

swarm-index-document
string
Example: index.html

Default file to be referenced on path, if exists under that path

swarm-error-document
string
Example: error.html

Configure custom error document to be returned when a specified path can not be found in collection

Content-Type
string

The specified content-type is preserved for download of the asset

Request Body schema: application/x-tar
string <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Get index document from a collection of files

Authorizations:
path Parameters
required
string or string or string

Swarm address of content

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

Get referenced file from a collection of files

Authorizations:
path Parameters
required
string or string or string

Swarm address of content

path
required
string

Path to the file in the collection.

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

Tag

Get list of tags

Authorizations:
query Parameters
offset
integer >= 0
Default: 0

The number of items to skip before starting to collect the result set.

limit
integer [ 1 .. 1000 ]
Default: 100

The numbers of items to return.

Responses

Response samples

Content type
application/json
{
  • "tags":
    [
    ]
}

Create Tag

Authorizations:
Request Body schema: application/json
address
string ^[A-Fa-f0-9]{64}$

Responses

Request samples

Content type
application/json
{
  • "address": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Response samples

Content type
application/json
{
  • "uid": 0,
  • "startedAt": "2020-06-11T11:26:42.6969797+02:00",
  • "total": 0,
  • "processed": 0,
  • "synced": 0
}

Get Tag information using Uid

Authorizations:
path Parameters
uid
required
integer

Uid

Responses

Response samples

Content type
application/json
{
  • "uid": 0,
  • "startedAt": "2020-06-11T11:26:42.6969797+02:00",
  • "total": 0,
  • "processed": 0,
  • "synced": 0
}

Delete Tag information using Uid

Authorizations:
path Parameters
uid
required
integer

Uid

Responses

Response samples

Content type
application/problem+json
"string"

Update Total Count and swarm hash for a tag of an input stream of unknown size using Uid

Authorizations:
path Parameters
uid
required
integer

Uid

Request Body schema: application/json

Can contain swarm hash to use for the tag

address
string ^[A-Fa-f0-9]{64}$

Responses

Request samples

Content type
application/json
{
  • "address": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Response samples

Content type
application/json
{
  • "status": "string"
}

Chunk pinning

Pin chunk with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of chunk

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Unpin chunk with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of chunk

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Get pinning status of chunk with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of chunk

Responses

Response samples

Content type
application/json
{
  • "address": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f",
  • "pinCounter": 0
}

Update chunk pin counter

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of chunk

Responses

Response samples

Content type
application/json
{
  • "address": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f",
  • "pinCounter": 0
}

Get list of pinned chunks

Authorizations:
query Parameters
offset
integer >= 0
Default: 0

The number of items to skip before starting to collect the result set.

limit
integer [ 1 .. 1000 ]
Default: 100

The numbers of items to return.

Responses

Response samples

Content type
application/json
{
  • "chunks":
    [
    ]
}

Bytes pinning

Pin bytes with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of the bytes

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Unpin bytes chunks with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of the bytes

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

File pinning

Pin file with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of the file

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Unpin file chunks with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of the file

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Collection pinning

Pin collection with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of the collection

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Unpin file chunks with given address

Authorizations:
path Parameters
address
required
string ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

Swarm address of the collection

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Postal Service for Swarm

Send to recipient or target with Postal Service for Swarm

Authorizations:
path Parameters
topic
required
string

Topic name

targets
required
string

Target message address prefix. If multiple targets are specified, only one would be matched.

query Parameters
recipient
string

Recipient publickey

Responses

Response samples

Content type
application/problem+json
"string"

Pss subscribe

Subscribe for messages on the given topic.

Authorizations:
path Parameters
topic
required
string

Topic name

Responses

Response samples

Content type
application/problem+json
"string"

Single owner chunk

Upload single owner chunk

Authorizations:
path Parameters
owner
required
string ^[A-Fa-f0-9]{40}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906

Owner

id
required
string ^([A-Fa-f0-9]+)$
Example: cf880b8eeac5093fa27b0825906c600685

Id

query Parameters
sig
required
string ^([A-Fa-f0-9]+)$
Example: sig=cf880b8eeac5093fa27b0825906c600685

Signature

header Parameters
swarm-pin
boolean

Represents the pinning state of the chunk

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Feed

Create an initial feed root manifest

Authorizations:
path Parameters
owner
required
string ^[A-Fa-f0-9]{40}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906

Owner

topic
required
string ^([A-Fa-f0-9]+)$
Example: cf880b8eeac5093fa27b0825906c600685

Topic

query Parameters
type
string ^(sequence|epoch)$

Feed indexing scheme (default: sequence)

header Parameters
swarm-pin
boolean

Represents the pinning state of the chunk

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Find feed update

Authorizations:
path Parameters
owner
required
string ^[A-Fa-f0-9]{40}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906

Owner

topic
required
string ^([A-Fa-f0-9]+)$
Example: cf880b8eeac5093fa27b0825906c600685

Topic

query Parameters
at
integer

Timestamp of the update (default: now)

type
string ^(sequence|epoch)$

Feed indexing scheme (default: sequence)

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}