Skip to main content

Overview

Delete a feature by its ID. Features that are used in products or by customers cannot be deleted - archive them instead.

Endpoint

POST /v1/features.delete

Request Body

feature_id
string
required
The unique identifier of the feature to delete.Example: "old-feature", "test-feature"

Response

Returns a success flag confirming the deletion.
success
boolean
Whether the feature was successfully deleted.

Examples

const response = await fetch('https://api.autumn.com/v1/features.delete', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    feature_id: 'old-feature'
  })
});

const result = await response.json();
console.log(result); // { success: true }

Delete an Unused Feature

Request
{
  "feature_id": "old-feature"
}
Response
{
  "success": true
}

Important Restrictions

Cannot Delete Features in UseYou cannot delete a feature if:
  • It’s included in any product or plan
  • It’s being used by any customer
  • It’s referenced in a credit system’s credit_schema
Archive the feature instead using the Update Feature endpoint.
Deletion is PermanentDeleting a feature is irreversible. All configuration and metadata will be permanently removed. Consider archiving instead if you might need the feature later.

When to Delete vs Archive

Delete When:

  • The feature was created for testing and is not in use
  • You made a mistake during feature creation
  • The feature was never added to any products
  • You’re cleaning up duplicate or unused features

Archive When:

  • The feature is being used by any customers
  • The feature is part of any product or plan
  • You want to deprecate a feature but maintain backward compatibility
  • You might need the feature configuration later

Workflow Example

Safe Delete Workflow
// 1. First, try to get the feature
const getResponse = await fetch('https://api.autumn.com/v1/features.get', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ feature_id: 'old-feature' })
});

const feature = await getResponse.json();

// 2. Check if it's already archived
if (feature.archived) {
  console.log('Feature is archived, safe to delete if not in use');
}

// 3. Attempt deletion
try {
  const deleteResponse = await fetch('https://api.autumn.com/v1/features.delete', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ feature_id: 'old-feature' })
  });
  
  const result = await deleteResponse.json();
  
  if (result.success) {
    console.log('Feature deleted successfully');
  }
} catch (error) {
  console.error('Cannot delete feature - it may be in use');
  
  // 4. Archive instead if deletion fails
  const archiveResponse = await fetch('https://api.autumn.com/v1/features.update', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      feature_id: 'old-feature',
      archived: true
    })
  });
  
  console.log('Feature archived instead');
}

Use Cases

Clean Up Test Features

Remove features created during development and testing that are no longer needed.

Fix Mistakes

Delete incorrectly configured features that haven’t been used yet.

Remove Duplicates

Clean up duplicate features created by mistake.

Simplify Configuration

Remove unused features to keep your feature list clean and manageable.

Error Responses

code
string
Error code identifying the type of error.
message
string
Human-readable error message.

Common Errors

  • feature_not_found - No feature exists with this ID
  • feature_in_use - Cannot delete because it’s used in products or by customers
  • feature_referenced - Cannot delete because it’s referenced in a credit system
  • invalid_feature_id - Feature ID format is invalid
If you receive a feature_in_use error, use the Update Feature endpoint to archive it instead:
{
  "feature_id": "old-feature",
  "archived": true
}

Build docs developers (and LLMs) love