2024-07-27 15:37:58 +02:00
export const metadata = {
title: 'HTTP',
description:
2024-08-13 16:47:37 +02:00
'How Versia uses the HTTP protocol for all communications between instances.',
2024-07-27 15:37:58 +02:00
}
# HTTP
2024-08-13 16:47:37 +02:00
Versia uses the HTTP protocol for all communications between instances. HTTP requests must conform to certain standards to ensure compatibility between different implementations, as well as to ensure the security and integrity of the data being exchanged.
2024-07-27 15:37:58 +02:00
2025-06-07 22:54:59 +02:00
HTTP requests/responses between instances **must** include a [Signature](/signatures), signed with the [instance's private key](/entities/instance-metadata), as defined in [Signatures](/signatures).
2024-07-27 15:37:58 +02:00
## Requests
<Row>
<Col>
2024-12-24 14:01:09 +01:00
<Properties name="HTTP Request">
2024-07-27 15:37:58 +02:00
<Property name="Accept" type="string" required={true}>
2025-06-07 22:54:59 +02:00
Must be `application/vnd.versia+json`, unless specified otherwise. Basic `application/json` is **not** allowed.
2024-07-27 15:37:58 +02:00
</Property>
<Property name="Content-Type" type="string" required={true}>
2025-06-07 22:54:59 +02:00
Must be `application/vnd.versia+json; charset=utf-8` if the request has a body.
2024-07-27 15:37:58 +02:00
</Property>
2025-06-07 22:54:59 +02:00
<Property name="Versia-Signature" type="string" required={true}>
2024-08-06 17:14:22 +02:00
See [Signatures](/signatures) for more information.
2024-07-27 15:37:58 +02:00
</Property>
2025-06-07 22:54:59 +02:00
<Property name="Versia-Signed-By" type="Domain" required={true} typeLink="/api/basics#domain">
2024-08-06 17:14:22 +02:00
See [Signatures](/signatures).
</Property>
2025-06-07 22:54:59 +02:00
<Property name="Versia-Signed-At" type="number" required={true}>
2024-08-06 17:14:22 +02:00
See [Signatures](/signatures).
2024-07-27 15:37:58 +02:00
</Property>
<Property name="User-Agent" type="string" required={false}>
2025-06-07 22:54:59 +02:00
A string identifying the software making the request. Should contain the name of the software, its version, and a link to its homepage.
``` {{ 'title': 'Example User-Agent' }}
CoolServer/1.0 (https://coolserver.com)
```
2024-07-27 15:37:58 +02:00
</Property>
</Properties>
</Col>
<Col sticky>
```http {{ 'title': 'Example Request' }}
2025-05-05 14:08:20 +02:00
POST https://bob.com/.versia/v0.6/inbox HTTP/1.1
# This specific endpoint returns plain JSON
2024-07-27 15:37:58 +02:00
Accept: application/json
User-Agent: CoolServer/1.0 (https://coolserver.com)
2024-10-18 11:04:11 +02:00
Versia-Signature: /CjB2L9bcvRg+uP19B4/rqy7Ji9/cqMFPlL3GVCIndnQjYyOpBzJEAl9weDnXm7Jrqa3y6sBC+EYWKThO2r9Bw==
2025-05-05 14:08:20 +02:00
Versia-Signed-By: example.com
2024-10-18 11:04:11 +02:00
Versia-Signed-At: 1729241687
2024-07-27 15:37:58 +02:00
```
</Col>
</Row>
2024-10-18 11:19:02 +02:00
## Rate limits
2025-06-07 22:54:59 +02:00
Implementations **must** respect the rate limits of remote instances.
2024-10-18 11:19:02 +02:00
2025-06-07 22:54:59 +02:00
IETF draft [draft-polli-ratelimit-headers-02](https://www.ietf.org/archive/id/draft-polli-ratelimit-headers-02.html) **must** be used to communicate rate limits. Other rate limit headers/formats are not allowed.
2024-10-18 11:19:02 +02:00
<Note>
This IETF draft is, well, a draft. However, there are no standards for rate limiting in HTTP, so this is the best we have.
</Note>
2024-07-27 15:37:58 +02:00
## Responses
<Row>
<Col>
2024-12-24 14:01:09 +01:00
<Properties name="HTTP Response">
2024-07-27 15:37:58 +02:00
<Property name="Content-Type" type="string" required={true}>
2025-05-05 14:08:20 +02:00
Must include `application/vnd.versia+json; charset=utf-8`, unless specified otherwise.
2024-07-27 15:37:58 +02:00
</Property>
2025-06-07 22:54:59 +02:00
<Property name="Versia-Signature" type="string" required={true}>
2024-08-06 17:14:22 +02:00
See [Signatures](/signatures) for more information.
</Property>
2025-06-07 22:54:59 +02:00
<Property name="Versia-Signed-By" type="Domain" required={true} typeLink="/api/basics#domain">
2024-08-06 17:14:22 +02:00
See [Signatures](/signatures).
2024-07-27 15:37:58 +02:00
</Property>
2025-06-07 22:54:59 +02:00
<Property name="Versia-Signed-At" type="number" required={true}>
2024-08-06 17:14:22 +02:00
See [Signatures](/signatures).
2024-07-27 15:37:58 +02:00
</Property>
</Properties>
</Col>
<Col sticky>
```http {{ 'title': 'Example Response' }}
HTTP/1.1 200 OK
2025-05-05 14:08:20 +02:00
Content-Type: application/vnd.versia+json; charset=utf-8
2024-10-18 11:04:11 +02:00
Versia-Signature: /CjB2L9bcvRg+uP19B4/rqy7Ji9/cqMFPlL3GVCIndnQjYyOpBzJEAl9weDnXm7Jrqa3y6sBC+EYWKThO2r9Bw==+7BvnWKITyGyTwHbb6fVYwRx1I
2025-05-05 14:08:20 +02:00
Versia-Signed-By: example.com
2024-10-18 11:04:11 +02:00
Versia-Signed-At: 1729241717
2024-07-27 15:37:58 +02:00
```
</Col>
</Row>