API Reference
Site

Sites

Manages a site's static files and configuration (which protocols to seed to, domain, etc.)

These are authenticated endpoints. Requests to these endpoints must include a JWT Bearer token in the header of the request. Please see the documentation on authorization for how to go about obtaining a valid JWT token.

Getting the information of site

GET/v1/sites/:domain
Resource ownerAdmin

Takes a single path parameter domain and returns the configuration and info about the site.

Making a site

POST/v1/sites
PublisherAdmin

Takes a JSON payload containing the domain of the site along with which protocols to seed to.

type InputPayload = {
  "domain": string,
  "protocols": {
    "http": boolean,
    "hyper": boolean,
    "ipfs": boolean
  }
}
⚠️

Note that this does not include the actual site content itself. See the endpoint for uploading content to do that.

Deleting a site

DELETE/v1/sites/:domain
Resource ownerAdmin

Takes a single path parameter domain and deletes the site.

Updating a site's configuration

POST/v1/sites/:domain
Resource ownerAdmin

Takes a single path parameter domain and a JSON payload containing details about which protocols to seed to.

type InputPayload = {
  "protocols": {
    "http": boolean,
    "hyper": boolean,
    "ipfs": boolean
  }
}

Uploading content to a site

PUT/v1/sites/:domain

PATCH/v1/sites/:domain
Resource ownerAdmin

Takes a single path parameter domain and uploads the attached tarball as the site content.

The body must be of type multipart/form-data with a single tar.gz file which will get extracted out and served. Using the PUT endpoing will delete any existing files before uploading the new files. PATCH on the other hand, will only upload new files in the tarball.