ServerOps.ggbeta
API ReferenceMedia

Upload a file (base64)

Upload a file as a base64-encoded JSON body. Useful for environments where multipart/form-data is inconvenient, such as Lua HTTP clients in FiveM/RedM.

Maximum decoded payload: 10 MB. Maximum raw JSON body: 14 MB.

Requires media:write scope.

POST
/media/base64

Authorization

bearerAuth media:write
AuthorizationBearer <token>

API token from your dashboard.

Format: so_live_... (production) or so_test_... (test mode).

Tokens carry one or more scopes. Request only the scopes your integration needs:

ScopeGrants
media:readList and retrieve files
media:writeUpload and delete files
logs:readRead log entries
logs:writeIngest log entries
cases:readRead cases
cases:writeCreate and update cases
apps:readRead apps
apps:writeSubmit apps
usage:readRead quota usage
members:readList organisation members
members:writeInvite and remove members
billing:readRead billing and subscription info
tokens:writeCreate and revoke API tokens

In: header

Scope: media:write

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/media/base64" \  -H "Content-Type: application/json" \  -d '{    "filename": "screenshot.png",    "content_type": "image/png",    "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="  }'
{
  "id": "f_01HZXXXXXXXXXXXXXXXXXXXXX",
  "url": "https://media.serverops.gg/p_01HZ.../screenshot.png",
  "key": "string",
  "size": 2097152,
  "content_type": "image/png",
  "sha256": "string",
  "original_name": "screenshot.png",
  "tags": [
    "string"
  ],
  "folder": "string",
  "abuse_status": "clean",
  "visibility": "public",
  "storage_class": "standard",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "bad_request",
    "message": "missing required field"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "missing or invalid authorization token"
  }
}

{
  "error": {
    "code": "forbidden",
    "message": "token does not have the required scope"
  }
}

{
  "error": {
    "code": "too_large",
    "message": "file exceeds maximum allowed size"
  }
}
{
  "error": {
    "code": "quota_exceeded",
    "message": "tier quota exceeded for storage_bytes",
    "metric": "storage_bytes",
    "quotas": [
      {
        "metric": "storage_bytes",
        "used": 10737418240,
        "limit": 10737418240,
        "cumulative": true
      }
    ]
  }
}
{
  "error": {
    "code": "internal",
    "message": "an unexpected error occurred"
  }
}
{
  "error": {
    "code": "storage_error",
    "message": "failed to write to storage"
  }
}