API keys and the API

Creating and revoking keys, one-time upload links for players, and the routes your scripts call.

Media Storage2 min read

On this page
  1. Keys
  2. Uploads from players
  3. Uploading from a server
  4. Other routes
  5. Fivemanage's routes

Keys

Keys are made on a team's API keys tab. Each key has permissions:

PermissionLets the key
ReadList files and read their details
WriteUpload files and change them
DeleteMove files to the bin
Send logsSend logs to fxvault Logs
Read logsSearch and read logs

Create one key per script or server, so you can revoke just that one later. A key is shown once, when it is created; the panel stores only a hash of it. The table shows when each key was last used, and warns if a key was ever seen in a URL.

Send the key in the Authorization header. Never put it in a link or in anything players' games receive: anyone who has it can use it. Revoking a key stops it within a minute; files it uploaded stay.

S3 keys are separate and live in their own section of the same tab. See S3 access.

The API keys tab. Each key shows its permissions and when it was last used; the ps-camera key carries the “Seen in a URL” warning, the cue to revoke it and make a new one, and a revoked key stays listed, dimmed. S3 keys have their own section below. Example view.

Uploads from players

A player's game should never hold your key. Instead, your server asks for a one-time upload link with the key, and hands the link to the player:

POST https://api.fxvault.link/v1/uploads
Authorization: YOUR_API_KEY
Content-Type: application/json
 
{ "kinds": ["image"], "expiresIn": 300, "path": "phone", "metadata": { "player": "license:..." } }

The answer holds the link and when it expires (at most 15 minutes). The player's game posts the file to the link as a form field named file. Each link takes one file, and the metadata your server signed into it cannot be changed by the player.

Player's gameNever holds the keyYour serverHolds the API keyapi.fxvault.linkUpload and management API1POST /v1/uploadswith the key: kinds,expiresIn, path, metadata2The link, and when it expiresat most 15 minutes3Hands over the linknever the key4Posts the file to the linkas the form field file;one file per linkSaved to your team's filesWith the metadata your server signedinto the link. The player cannotchange it.1Your serverapi.fxvault.linkPOST /v1/uploadswith the key: kinds, expiresIn, path,metadata2api.fxvault.linkYour serverThe link, and when it expiresat most 15 minutes3Your serverPlayer's gameHands over the linknever the key4Player's gameapi.fxvault.linkPosts the file to the linkas the form field file; one file per linkSaved to your team's filesWith the metadata your server signed intothe link. The player cannot change it.
One player upload. Your server spends the key on asking for the link; the player's game only ever holds the link, which takes one file and carries the metadata your server put in it. Illustration.

Uploading from a server

POST https://api.fxvault.link/v1/files
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
 
file=<the file>  path=cams  visibility=public|private  metadata={"server":"main"}

The answer is the file, with its permanent address. Only images (PNG, JPEG, WebP, GIF, AVIF), video (MP4, WebM, MOV) and audio (MP3, OGG, WAV, WebM) are accepted, checked from the bytes, not the name. Files larger than 50 MB go up in parts through /v1/multipart.

Other routes

RouteWhat it does
GET /v1/filesLists files, newest first, by folder, type or date
GET /v1/files/<id>One file's details
PATCH /v1/files/<id>Rename it, move it to another folder, or change its visibility
DELETE /v1/files/<id>Moves it to the bin
POST /v1/files/<id>/restoreBrings it back from the bin
POST /v1/files/<id>/sign?ttl=3600A link to a private file, valid for ttl seconds (60 to 30 days)
GET /v1/usageStorage and this month's delivery against the plan

Fivemanage's routes

api.fxvault.link also answers the routes scripts use with Fivemanage, with your key in the same Authorization header: /api/v3/file, /api/v3/file/presigned-url, /api/v2/presigned-url, and the older /api/image, /api/video, /api/audio and /v1/media/... routes. A script with a Fivemanage address setting works by swapping the address. Its log routes (/api/v3/logs, /api/logs/batch and /api/logs) store logs in fxvault Logs; see Send logs from Fivemanage scripts. They need a key with Send logs.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.