Signatures

Generate signed URLs

Generate a signed URL for accessing a file

Creates a cryptographically signed URL that provides temporary and restricted access to a file. The URL can expire after a specified time and be limited to specific HTTP methods.

POST
/signatures

Authorization

AuthorizationRequiredBearer <token>

Requires a Bearer token in the Authorization header. Format: Authorization: Bearer ITTYBIT_API_KEY

In: header

Request Body

application/jsonRequired

Parameters for the signature generation, including the file details, expiration time, and permitted HTTP method.

filenameRequiredstring

The name of the file to generate a signature for. Special characters will be sanitised.

folderstring

Optional folder path where the file resides. Special characters will be sanitised.

expiryinteger

Optional expiry time for the signature in seconds since epoch. Defaults to 60 minutes from now. Must be a positive integer and in the future.

Format: "int64"
methodstring

Optional HTTP method allowed for the signed URL. Defaults to 'get'.

Default: "get"Value in: "get" | "put" | "post" | "delete"

Response Body

Signed URL generated successfully

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataobject
linksobject
curl -X POST "https://api.ittybit.com/signatures" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "video.mp4",
    "folder": "private/user_123",
    "expiry": 1735689600,
    "method": "get"
  }'

{
  "meta": {
    "id": "req_sig123",
    "status": 200,
    "object": "signature"
  },
  "data": {
    "domain": "my-project.ittybit.net",
    "filename": "video.mp4",
    "folder": "private/user_123",
    "expiry": 1735689600,
    "method": "get",
    "signature": "a1b2c3d4e5f6...",
    "url": "https://my-project.ittybit.net/.../video.mp4?expiry=...&signature=..."
  },
  "links": {
    "self": "/signatures"
  }
}