Skip to main content
DELETE
/
api
/
v1
/
attributes
/
{name}
Delete Attribute
curl --request DELETE \
  --url https://api.example.com/api/v1/attributes/{name}
// No response body - successful deletion

Overview

Permanently removes an attribute from the BOOP Network. This endpoint should be used with extreme caution as it affects the entire system and may break existing integrations.
Deleting an attribute is a destructive operation that cannot be undone. Ensure no active vendors or users depend on this attribute before deletion.

Path Parameters

name
string
required
The unique name of the attribute to delete (e.g., “deprecated-field”)

Response

success
boolean
Indicates successful deletion (no response body for 204 status)
// No response body - successful deletion

Usage Examples

async function deleteAttribute(attributeName) {
  const response = await fetch(
    `https://dev.app.boop.it/api/v1/attributes/${attributeName}`,
    {
      method: 'DELETE',
      headers: {
        'X-API-Key': 'your-api-key'
      }
    }
  );

  if (response.status === 204) {
    return true; // Successfully deleted
  }

  if (response.status === 404) {
    throw new Error(`Attribute '${attributeName}' not found`);
  }

  if (response.status === 409) {
    const error = await response.json();
    throw new Error(`Cannot delete: ${error.message}`);
  }

  throw new Error(`Unexpected error: ${response.statusText}`);
}

// Safe deletion with confirmation
async function safeDeleteAttribute(attributeName) {
  try {
    // First check if attribute exists
    const attr = await getAttributeDetails(attributeName);

    console.warn(
      `About to delete attribute '${attributeName}' (${attr['data-format']})`
    );

    if (attr['attestation-required']) {
      console.warn('This is an attestation-required attribute!');
    }

    // Perform deletion
    await deleteAttribute(attributeName);
    console.log(`Attribute '${attributeName}' deleted successfully`);

    return true;
  } catch (error) {
    console.error(`Failed to delete attribute: ${error.message}`);
    return false;
  }
}

Pre-Deletion Checklist

Before deleting an attribute, verify:
  1. No active usage: Check that no vendors currently request this attribute
  2. No user data: Ensure no users have this attribute in their profiles
  3. Documentation updated: Remove references from integration docs
  4. Backwards compatibility: Consider deprecation period instead of immediate deletion

Usage Validation Script

async function validateAttributeDeletion(attributeName) {
  const checks = {
    attributeExists: false,
    activeVendors: [],
    userDataExists: false,
    safeTodelete: false
  };

  try {
    // Check if attribute exists
    await getAttributeDetails(attributeName);
    checks.attributeExists = true;

    // TODO: Add checks for:
    // - Active vendor configurations requesting this attribute
    // - User records containing this attribute
    // - System dependencies

    checks.safeTodelete =
      checks.attributeExists &&
      checks.activeVendors.length === 0 &&
      !checks.userDataExists;

  } catch (error) {
    if (error.message.includes('not found')) {
      console.log(`Attribute '${attributeName}' already doesn't exist`);
    }
  }

  return checks;
}

// Usage
const validation = await validateAttributeDeletion('old-field');
if (validation.safeTodelete) {
  await deleteAttribute('old-field');
} else {
  console.log('Attribute is not safe to delete:', validation);
}

Migration Strategy

When removing attributes, consider a migration approach:

1. Deprecation Period

// Mark attribute as deprecated (if system supports it)
await updateAttributeMetadata('old-field', {
  deprecated: true,
  deprecationDate: new Date().toISOString(),
  migrateTo: 'new-field'
});

2. Data Migration

// Migrate data to new attribute format
async function migrateAttributeData(oldAttr, newAttr) {
  // 1. Create new attribute
  await createAttribute(newAttr);

  // 2. Migrate existing user data
  // 3. Update vendor configurations
  // 4. Delete old attribute

  await deleteAttribute(oldAttr.name);
}

3. Vendor Notification

// Notify vendors before deletion
async function notifyVendorsOfDeletion(attributeName, deletionDate) {
  // Send notifications to vendors using this attribute
  // Provide migration timeline and alternatives
}

Common Deletion Scenarios

Deprecated Attributes

Remove attributes that are no longer needed:
# Remove old naming convention
curl -X DELETE \
  -H "X-API-Key: your-api-key" \
  https://dev.app.boop.it/api/v1/attributes/user_email

# After migrating to new naming
curl -X DELETE \
  -H "X-API-Key: your-api-key" \
  https://dev.app.boop.it/api/v1/attributes/legacy-id

Test Attributes

Clean up development/testing attributes:
const testAttributes = [
  'test-field-1',
  'debug-attribute',
  'temp-identifier'
];

for (const attr of testAttributes) {
  await deleteAttribute(attr);
}

Error Handling

Status CodeMeaningAction
204Successfully deletedContinue with workflow
404Attribute not foundVerify attribute name spelling
409Attribute in useCheck dependencies, plan migration
401UnauthorizedVerify API key has admin permissions
500Server errorRetry request, contact support

Security Considerations

  • Restrict deletion permissions to system administrators only
  • Log all attribute deletions for audit purposes
  • Implement confirmation mechanisms for destructive operations
  • Consider soft deletion with recovery period for critical attributes

Recovery Options

If an attribute is accidentally deleted:
  1. Recreate immediately with the same specification
  2. Restore from backup if data migration is needed
  3. Contact support for assistance with data recovery

Rate Limits

  • 5 attribute deletions per minute per API key
  • 50 attribute deletions per hour per API key
  • Additional restrictions may apply for high-impact operations