Skip to main content

Delete AI Model

Used to delete an AI model and all its configurations. This permanently removes the model from your project.

API Endpoint

PropertyValue
Request MethodDELETE
Request URLhttps://api.seliseblocks.com/models/{model_id}

Request

Request Example

curl -X DELETE 'https://api.seliseblocks.com/models/{model_id}?project_key=YOUR_PROJECT_KEY' \
-H 'accept: application/json'

Path Parameters

FieldTypeRequiredDescription
model_idstringYesThe unique identifier of the model to delete.

Query Parameters

FieldTypeRequiredDescription
project_keystringNoThe project key for your project.

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
warning

Permanent Deletion Warning

  • This operation permanently deletes the model and cannot be undone
  • All model configurations, credentials, and settings will be removed
  • AI agents using this model will no longer be able to access it
  • Conversation history using this model is retained but marked as using a deleted model
  • Usage statistics and metrics for this model will be preserved for audit purposes
tip

Before deleting a model:

  • Check which AI agents are currently using this model
  • Identify conversations that depend on this model
  • Export or backup model configuration if you may need it later
  • Consider deactivating the model instead of deleting (set IsActive to false)
  • Notify team members who may be using the model
  • Update documentation to reflect the removal
  • Ensure you have alternative models configured for agents

After successful deletion:

  • Update AI agents to use different models
  • Remove references to the model from agent configurations
  • Update any scripts or automations that reference the model
  • Clear cached model data in your applications
  • Document the deletion for audit purposes
  • Monitor affected agents for proper operation

Response

Success Response (200 OK)

Returns an object containing the deletion status.

{
"is_success": true,
"item_id": "model_123",
"detail": "AI model deleted successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the deletion was successful.
item_idstringThe identifier of the deleted model.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request parameters are invalid.

{
"detail": [
{
"loc": [
"path",
"model_id"
],
"msg": "model not found or already deleted",
"type": "value_error.notfound"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., path, query).
msgstringHuman-readable error message.
typestringError type identifier.

Common Error Scenarios

Error TypeDescriptionResolution
Model Not FoundModel ID doesn't exist or was already deletedVerify the model_id is correct
Permission DeniedUser lacks permission to delete the modelCheck user permissions in project settings
Model In UseModel is currently being used by active agents or conversationsStop agent executions or switch agents to different models first
Invalid Model IDModel ID format is invalidEnsure model_id matches the expected format
Last ModelCannot delete the only model in the projectAdd another model before deleting this one

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid requestBad Request
403Forbidden - Insufficient permissionsForbidden
404Not Found - Model does not existNot Found
409Conflict - Model is in use and cannot be deletedConflict
422Validation Error - Invalid request parametersUnprocessable Entity