Skip to main content

signaloid-cli keys delete

Delete an API key.

Synopsis​

signaloid-cli keys delete --key-id <id>

Options​

OptionRequiredDescription
--key-id <id>YesKey ID to delete

Description​

Permanently deletes an API key. Once deleted, any applications or services using this key will no longer be able to authenticate with Signaloid Cloud Compute Engine.

Examples​

Delete a Key​

signaloid-cli keys delete --key-id key_abc123

Output:

✔ API key deleted
{
"message": "OK"
}

Delete with Confirmation​

Delete Keys Older than 1 Year​

ONE_YEAR_AGO=$(date -d '1 year ago' +%s)000

signaloid-cli keys list | \
jq --arg cutoff "$ONE_YEAR_AGO" -r '.Keys[] |
select(.CreatedAt | fromdateiso8601 * 1000 < ($cutoff | tonumber)) |
.KeyID' | \
while read KEY_ID; do
echo "Deleting old key: $KEY_ID"
signaloid-cli keys delete --key-id $KEY_ID
done

Safe Key Rotation with Delete​

#!/bin/bash
# Rotate API key safely

OLD_KEY_ID="key_old123"
KEY_NAME="Production API Key"

# 1. Create new key
echo "Creating new key..."
NEW_KEY_RESPONSE=$(signaloid-cli keys create --name "$KEY_NAME")
NEW_KEY=$(echo "$NEW_KEY_RESPONSE" | jq -r '.Key')

# 2. Test new key
export SIGNALOID_API_KEY="$NEW_KEY"
if signaloid-cli auth whoami; then
echo "✓ New key works"
else
echo "✗ New key failed"
exit 1
fi

# 3. Update deployment
echo "Update your deployment with new key: $NEW_KEY"
read -p "Press enter after updating deployment..."

# 4. Delete old key
signaloid-cli keys delete --key-id $OLD_KEY_ID
echo "Old key deleted"

Notes​

  • Key deletion is permanent and cannot be undone
  • Applications using the deleted key will immediately lose access
  • Consider rotating keys (creating a new one first) instead of deleting if the key is currently in use
  • Verify the key ID before deletion to avoid accidentally deleting the wrong key

Troubleshooting​

"Key not found" Error​

Problem: Cannot delete or access key.

Solutions:

  1. List all keys to verify ID:
    signaloid-cli keys list
  2. Check for typos in key ID
  3. Verify key was not already deleted
  4. Ensure you have permission to manage keys

See Also​