> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snipp.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Relay Overview

> Base URL, authentication, endpoints, and behavior for the Snipp Relay API.

## Overview

Relay is the Snipp API geared toward the full user experience. It mirrors the public API for uploads and posts, and adds the discover feed, likes, comments, notifications, blocking, profile editing, avatar and banner uploads, and view counting.

Relay is intended for first-party clients (for example, the Snipp mobile app). For third-party integrations and SDKs, use the [public API](/api-reference/introduction) at `api.snipp.gg`.

## Base URL

The default base URL is:

```
relay.snipp.gg
```

`relay.snipp.gg` is proxied and load-balanced through Cloudflare. It picks the closest healthy region for you, so it's the fastest option for most requests. Because Cloudflare proxies the traffic, uploads on this host are capped at **100 MB per request**.

### Regional endpoints

For uploads larger than 100 MB (or when you want to pin a specific region), use a regional endpoint instead. Regional endpoints are unproxied, so there is no 100 MB cap. Your file size limit is whatever your plan allows.

| Region  | Host                       |
| ------- | -------------------------- |
| EU West | `eu-west-1.relay.snipp.gg` |
| US West | `us-west-1.relay.snipp.gg` |

You can mix and match. Use `relay.snipp.gg` for everyday calls and switch to a regional endpoint only when an upload exceeds 100 MB.

To confirm which region served a request, hit [`GET /region`](/relay-reference/endpoint/region) on any host.

## Authentication

Relay uses a `relay-key` header. Each Snipp account has a unique relay key. Treat it like a password.

```
relay-key: YOUR_RELAY_KEY
```

Generate, regenerate, or delete your relay key from [snipp.gg/settings/relay](https://snipp.gg/settings/relay). Keys are 32 alphanumeric characters (`[A-Za-z0-9]`).

A missing, empty, or unrecognized relay key returns `401`.

## Endpoints

| Method   | Endpoint                | Description                                                      |
| -------- | ----------------------- | ---------------------------------------------------------------- |
| `GET`    | `/users/{id}`           | Fetch a user profile. Use `@me` for your own account.            |
| `GET`    | `/posts/{code}`         | Fetch a single post by share code.                               |
| `POST`   | `/upload`               | Upload an image or video file.                                   |
| `GET`    | `/uploads`              | List all of your uploads.                                        |
| `PATCH`  | `/editUpload`           | Update title, description, or privacy of a post.                 |
| `POST`   | `/appendUpload`         | Add files to an existing album.                                  |
| `DELETE` | `/deleteUpload`         | Delete a file or post.                                           |
| `GET`    | `/discover`             | Browse public uploads from the community.                        |
| `GET`    | `/blocks`               | List your blocked users.                                         |
| `POST`   | `/block`                | Block a user by ID.                                              |
| `POST`   | `/unblock`              | Unblock a user by ID.                                            |
| `POST`   | `/follow`               | Follow a user by ID.                                             |
| `POST`   | `/unfollow`             | Unfollow a user, or remove one of your own followers.            |
| `GET`    | `/followers`            | List the users following a profile.                              |
| `GET`    | `/following`            | List the users a profile is following.                           |
| `POST`   | `/like`                 | Like or unlike a post.                                           |
| `GET`    | `/comments`             | List comments on a post.                                         |
| `POST`   | `/comment`              | Create a comment on a post.                                      |
| `DELETE` | `/comment`              | Delete a comment.                                                |
| `POST`   | `/comment-like`         | Like or unlike a comment.                                        |
| `GET`    | `/notifications`        | List your notifications, newest first.                           |
| `GET`    | `/notifications/unread` | Number of unread notifications.                                  |
| `POST`   | `/notifications/read`   | Mark every notification as read.                                 |
| `GET`    | `/notification-prefs`   | Read your notification and email preferences.                    |
| `POST`   | `/notification-prefs`   | Update your notification and email preferences.                  |
| `POST`   | `/report-post`          | Report a post.                                                   |
| `POST`   | `/report-user`          | Report a user.                                                   |
| `PATCH`  | `/profile`              | Update profile fields.                                           |
| `POST`   | `/profile/avatar`       | Upload a new avatar.                                             |
| `POST`   | `/profile/banner`       | Upload a new banner.                                             |
| `PATCH`  | `/theme`                | Set your account color theme. Plus only.                         |
| `GET`    | `/gifs`                 | Browse public GIFs across Snipp, newest first. No auth required. |
| `GET`    | `/usage-history`        | Fetch your daily upload activity for the last 365 days.          |
| `GET`    | `/analytics`            | Fetch your analytics over time plus lifetime totals. Plus only.  |
| `GET`    | `/region`               | Return the region serving the request. No auth required.         |

## View Counting

Relay does not expose a dedicated view endpoint. Views increment automatically when a viewer hits `GET /posts/{code}` or `GET /discover`.

To prevent inflation, views are deduplicated per IP and post: an IP can contribute up to 3 counted views per post per hour. Views are only counted on public, non-moderated posts.

## Rate Limits

Rate limits apply per endpoint, not per account. See [Rate Limits](/concepts/rate-limits) for the full table and details on handling `429` responses.

## Error Format

All errors return a JSON object with an `error` field:

```json theme={null}
{
  "error": "Unauthorized. No relay-key header found."
}
```

## HTTP Status Codes

| Code  | Meaning                                                               |
| ----- | --------------------------------------------------------------------- |
| `200` | Success                                                               |
| `400` | Bad request. Invalid input, unsupported file type, or file too large. |
| `401` | Unauthorized. Missing or invalid relay key.                           |
| `403` | Forbidden. Account suspended or insufficient permissions.             |
| `404` | Not found                                                             |
| `413` | Payload too large. File exceeds your plan's size limit.               |
| `429` | Rate limit exceeded                                                   |
| `500` | Internal server error                                                 |
