Skip to main content

Delete Subname

Delete a subname. Only the owner can delete their subname.

Endpoint​

DELETE /api/subnames/{parent}/{name}

Authentication​

Owner verification required — You must be the subname owner.

Parameters​

ParameterTypeLocationRequiredDescription
parentstringpathâś…Parent ENS name (e.g., aboutme.eth)
namestringpathâś…Subname label to delete (e.g., alice)

Response​

{
"success": true,
"parent": "aboutme.eth",
"name": "alice",
"fullName": "alice.aboutme.eth",
"deleted": true,
"timestamp": "2024-02-10T14:30:00.000Z"
}

Examples​

cURL​

# Delete with SIWE authentication
curl -X DELETE "https://api.web3identity.com/api/subnames/aboutme.eth/alice" \
-H "Authorization: Bearer $TOKEN"

JavaScript​

async function deleteSubname(parent, name, token) {
const response = await fetch(
`https://api.web3identity.com/api/subnames/${parent}/${name}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${token}`
}
}
);

if (!response.ok) {
const error = await response.json();
throw new Error(error.message || 'Delete failed');
}

return response.json();
}

// Delete subname
const result = await deleteSubname('aboutme.eth', 'alice', siweToken);
console.log(`Deleted: ${result.fullName}`);

Important Notes​

Deletion is Permanent
  • All records associated with the subname are deleted
  • The name becomes available for anyone to register
  • This action cannot be undone
  • Consider transferring instead of deleting if you want someone else to have it

When to Delete​

ScenarioRecommendation
Want to release a nameâś… Delete
Give name to a friend❌ Use Transfer instead
Rename yourselfâś… Delete old, register new
Name expiredNot needed (auto-deleted)

Error Responses​

StatusCodeDescription
401UNAUTHORIZEDNo authentication provided
403NOT_OWNERYou don't own this subname
404NOT_FOUNDSubname does not exist
429RATE_LIMITEDRate limit exceeded
500SUBNAME_ERRORInternal server error
  • Transfer — Transfer instead of deleting
  • Get Details — Check ownership before deleting
  • Register — Register a new name after deleting