Skip to content
ctih edited this page Jul 26, 2024 · 6 revisions

The frii.site API!

Are you ready to use frii.site for your specifics needs?

Important

The API will be getting more permissions in the near future.

Getting started

  1. Create an API key by making a POST request to https://api.frii.site/create-api, with the following body.
{"domains":Array<string>, "perms":Array<string>,"comment":string}

and the following headers:

{"Content-Type":"application/json","X-Auth-Token":token (found in localstorage)}
More info

Permissions

Permission Name
Modifying the content content
Modifying the type type
Deleting the domain delete
View details of domain details

We will be using the domain "awesome-domain.frii.site" as an example for all of these.

  1. API key that can modifying a domain's content field:
{"domains":["awesome-domain"],"perms":["content"],"comment":"showcase"}
  1. API key that can modify a domain's type:
{"domains":["awesome-domain"],"perms":["type"],"comment":"Changing from A to NS"}
  1. API key that can delete domains:
{"domains":["awesome-domain"],"perms":["delete"],"comment":"Changing from A to NS"}
  1. API key that can do all of the above:
{"domains":["awesome-domain"],"perms":["content","type","delete"],"comment":"Changing from A to NS"}
  1. Make sure to store this API key somewhere secure. If someone get's a hold of it, they can do what ever they want with your domain.

Using the API

All endpoints that currently support API keys require a X-Api-Key header, where the content is the API key (WITH the $APIVx= prefix

Modifying a domain

Warning

You must specify every field, even if you aren't changing them.

Headers: "X-Api-Key":string

Body JSON: {"domain":string, "content":string, "type":string}

cURL:

curl -X PATCH -H "Content-Type: application/json" -H "X-Api-Key: $APIV1=xxxxx" --data "{\"domain\":\"awesome-domain\",\"content\":\"1.2.3.4\",\"type\":\"A\"}" https://api.frii.site/modify-domain
Status Response
200 Succesfully modified the domain
403 API Does not have correct perms
422 Domain is invalid
500 Action succeeded, but Cloudflare did not accept the domain
Clone this wiki locally