Skip to content

Delete fonts

Delete one or multiple fonts by their names. All fonts with the specified names will be deleted for your account. If you have multiple fonts with the same name, all of them will be deleted.

Sample Request

Here’s a sample request to delete fonts:

ENDPOINT
DELETE /v1/fonts?fonts=FONT_NAME_1&fonts=FONT_NAME_2
// Delete single font
fetch(`https://api.templated.io/v1/fonts?fonts=${encodeURIComponent('My Custom Font')}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${API_KEY}`
}
})
.then(response => response.json())
.then(data => console.log('Response:', data))
.catch(error => console.error('Error:', error));
// Delete multiple fonts
const fontNames = ['My Custom Font', 'Another Font'];
const params = fontNames.map(name => `fonts=${encodeURIComponent(name)}`).join('&');
fetch(`https://api.templated.io/v1/fonts?${params}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${API_KEY}`
}
})
.then(response => response.json())
.then(data => console.log('Response:', data))
.catch(error => console.error('Error:', error));

Response

Success Response

A successful deletion will return a 200 OK response with details about the deleted fonts:

{
"deleted": ["font-id-1", "font-id-2", "font-id-3"],
"deleted_by_name": {
"My Custom Font": 2,
"Another Font": 1
},
"message": "Successfully deleted 3 font(s)"
}

The deleted_by_name object shows how many fonts were deleted for each font name. This is useful when you have multiple fonts with the same name.

Error Responses

Status CodeDescriptionResponse Body
400Bad Request - Font name(s) not found{"not_found": ["Font Name"], "error": "Cannot delete fonts: no fonts found with the specified name(s) for this user"}
400Bad Request - No font names provided{"error": "At least one font name must be provided"}
401Not authorized - Invalid or missing API key{"error": "Not authorized"}
404Not Found - User not found{"error": "User not found"}
500Internal Server Error - An unexpected error occurred{"error": "An unexpected error occurred"}

Important Notes

  • Atomic Operation: Either all fonts with the specified names are deleted, or none are deleted. If any font name has no matching fonts, the entire operation fails.
  • Bulk Support: You can delete fonts with multiple names in a single request by passing multiple fonts parameters.
  • Multiple Fonts: If you have multiple fonts with the same name, all of them will be deleted when that name is specified.
  • Name Matching: Font names must match exactly (case-sensitive).

Query Parameters

ParameterTypeRequiredDescription
fontsstring[]YesOne or more font names to delete. Pass multiple fonts parameters for bulk deletion. All fonts with matching names will be deleted.