feat: Document basics of S2S Federation API, and some endpoints
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-05-01 20:09:59 +02:00
parent 3f94eff3e3
commit 71064dea2c
No known key found for this signature in database
6 changed files with 187 additions and 0 deletions

27
app/api/basics/page.mdx Normal file
View file

@ -0,0 +1,27 @@
export const metadata = {
title: "API",
description: "Defines the server-to-server API for Versia's federation.",
}
# API
Versia defines a very simple API for server-to-server communication, mainly fetching and sending entities. It is clearly namespaced and versioned, to avoid confusion with implementations' existing HTTP APIs. {{ className: "lead" }}
## API Versioning
Every Versia API endpoint is prefixed with `/.versia/vX/`, where `X` is the version of the API. The current version is `0.6`, so the current API prefix is `/.versia/v0.6/`. This versioning is used to avoid breaking changes in the future, and to allow for backwards compatibility.
<Note>
Implementations have no obligations to support more than one Versia version. It is recommended to always support the latest version, as it helps avoid bogging down the network with old versions.
</Note>
## Signatures
- All API requests **MUST** be signed, unless otherwise specified. This includes `POST` and `GET` requests.
- All API responses **MUST** be signed, unless otherwise specified.
The signature mechanism is defined in the [Signatures](/signatures) document.
## Encoding
"URL-encoding" is the mechanism used to encode data containing special characters in URLs. When this specification refers to "URL-encoding", it means the encoding defined in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1).