v1

latestSwagger 2.02026-07-146610689.7 KB
v2

Get JWT protected URL

JWT protection is a powerful way to protect your files from being seen without permission. Use this API method to generate a token that can be appended to a URL or set of URLs, allowing a file to be served. Without a valid token, requests for any file within a JWT protected folder will be denied. Before using this method, you must enable JWT folder protection and obtain a key. Read the documentation to learn how to enable and use JWT protection: https://sirv.com/help/json-web-token-protected-signed-url#enable-jwt-protection

post/v2/files/jwt

Request body

filenamestring required
keystring required

Specify JWT secret

aliasstring

Specify account alias if your account has multiple aliases

insecureParamsMinify
secureParamsSecureParams
expiresInnumber required

Token expiration time in seconds

Example request

{
  "filename": "/REST API Examples/aurora.jpg",
  "key": "cIxWUYfCjRHAy1BpcoIVNI5TivXszVPq",
  "alias": "demo-jwt",
  "expiresIn": 300
}

Response

Successful