https://orbiter.host/orbiter.pngOfficial documentation for Orbiter Skip to content

Create Site

POST
/sites

Creating a site requires a CID and the subdomain you want to use in .orbiter.website. To get a CID you can use the /keys/upload_key API route to generate a one time use key for Pinata. Here is an example code snippet on the flow

import { PinataSDK } from "pinata-web3"

const pinata = new PinataSDK({
  pinataJwt: "",
  pinataGateway: ""
})

const keyReq = await fetch("https://api.orbiter.host/keys/upload_key", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Orbiter-API-Key": "<YOUR-API-KEY>"
  },
  body: null
})

const keyRes = await keyReq.json()
const files: File[] = [] // Get a folder of files either locally or through a front end
const upload = await pinata.upload.fileArray(files).key(keyRes.data)

const deploySite = await fetch("https://api.orbiter.host/sites", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Orbiter-API-Key": "<YOUR-API-KEY>"
  },
  body: JSON.stringify({
    cid: upload.IpfsHash,
    subdomain: "my-site"
  })
})

Authorizations

Request Body

object
cid
string
bafybeifhp4bi22dq3cslzoana774ahxs4abaevik2zjd33645hhz2mzyia
subdomain
string
my-next-site
Examples
{
"cid": "bafybeifhp4bi22dq3cslzoana774ahxs4abaevik2zjd33645hhz2mzyia",
"subdomain": "my-next-site"
}

Responses

200

Create Site