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.

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 or cap its usage.

FieldTypeDescriptionDefault
nametextKey name
maxUsagenumberMax uses. Optional cap on how many times the key can be used.
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": "65f0c2…",
"name": "kiosk-lobby",
"type": "widget",
"tier": "standard",
"key": "dk_live_… (shown only on creation)",
"maskedKey": "dk_live_abcd…7f21",
"domains": [
"app.company.com"
],
"allowedOperations": [
"createRoom"
],
"expiresAt": "2026-12-31T23:59:59.000Z",
"isActive": true,
"usageCount": 0
}
}

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
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"}'

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"}'

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 (1–100)Page size20
curl "https://mediasfu.com/v1/disposable-keys?action=get" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY"

Example response:

{
"success": true,
"disposableKeys": [
{
"id": "65f0c2…",
"name": "kiosk-lobby",
"maskedKey": "dk_live_abcd…7f21",
"isActive": true,
"usageCount": 42
}
],
"total": 1,
"startIndex": 0,
"pageSize": 20
}

See errors and response format for failure handling.