Skip to main content

Disposable API keys API

Short-lived keys for embedding widgets or one-off integrations. The full value is shown only once on create.

Endpoint: https://mediasfu.com/v1/disposable-keys

Authenticate with Authorization: Bearer <api-username>:<api-key> from your server. Try every action and copy the request in the API Sandbox.

▶ Watch this: API keys and disposable keys, from 0:41.

Create a key​

POST https://mediasfu.com/v1/disposable-keys with action: "create"

Mint a new disposable key. Copy it immediately — it is shown once.

Required fields​

FieldTypeDescriptionDefault
typetempsand, tempprodEnvironment"tempsand"

Optional: Options​

Name it, set when it expires and where it may be used.

FieldTypeDescriptionDefault
nametextKey name
validityDaysnumberValid for (days). Leave empty or 0 for a key that never expires.
domainsarray of textAllowed domains. Required for production keys; also enforced on sandbox keys when set.
curl -X POST https://mediasfu.com/v1/disposable-keys \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"create","type":"tempsand"}'

Example response:

{
"success": true,
"message": "Disposable key created successfully",
"disposableKey": {
"id": "<key id>",
"type": "tempsand",
"tier": "standard",
"name": "website-widget",
"domains": [],
"expiresAt": null,
"isActive": true,
"usageCount": 0,
"lastUsedAt": null,
"rateLimit": {
"requests": 90,
"window": 60
},
"allowedOperations": [
"createRoom",
"updateRoom",
"deleteRoom",
"…"
],
"createdAt": "2026-10-26T14:00:00.000Z",
"updatedAt": "2026-10-26T14:00:00.000Z",
"failedAttempts": 0,
"autoDisabled": false,
"deactivationReason": null,
"key": "tempsand<56 hex characters, shown only once>",
"maskedKey": "tempsand1a2b...9f0e"
}
}

Update a key​

POST https://mediasfu.com/v1/disposable-keys with action: "update"

Rename or adjust a key.

No fields are required.

Optional: Identify the key​

Provide the key name or its ID.

FieldTypeDescriptionDefault
nametextKey name
keyIdtextKey ID

Optional: Changes​

What to change.

FieldTypeDescriptionDefault
newNametextNew name
domainsarray of textAllowed domains. Required for production keys; also enforced on sandbox keys when set.
curl -X POST https://mediasfu.com/v1/disposable-keys \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"update"}'

Example response:

{
"success": true,
"message": "Disposable key updated successfully",
"disposableKey": {
"id": "<key id>",
"name": "website-widget-v2",
"maskedKey": "tempsand1a2b...9f0e",
"…": "same fields as create, without key"
}
}

Revoke a key​

POST https://mediasfu.com/v1/disposable-keys with action: "delete"

Delete a disposable key.

No fields are required.

Optional: Identify the key​

Provide the key name or its ID to revoke.

FieldTypeDescriptionDefault
nametextKey name
keyIdtextKey ID
curl -X POST https://mediasfu.com/v1/disposable-keys \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"delete"}'

Example response:

{
"success": true,
"message": "Key revoked successfully",
"keyId": "<key id>"
}

List / get​

GET https://mediasfu.com/v1/disposable-keys with action: "get"

Retrieve records. Everything is optional — send as-is to list all.

No fields are required.

Optional: Filters​

All optional — narrow or page the results.

FieldTypeDescriptionDefault
startIndexnumberStart index0
pageSizenumber (10–50)Page size. Between 10 and 50.20
curl "https://mediasfu.com/v1/disposable-keys?action=get" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY"

Example response:

{
"success": true,
"disposableKeys": [
{
"id": "<key id>",
"type": "tempsand",
"tier": "standard",
"name": "website-widget",
"maskedKey": "tempsand1a2b...9f0e",
"isActive": true,
"usageCount": 42,
"…": "same fields as create, without key"
}
],
"total": 1,
"startIndex": 0,
"pageSize": 20
}

See errors and response format for failure handling.