Skip to main content

Delete Data Source

Sprint 3

Delete a data source. By default, this performs a soft delete. Use force=true for hard delete.

Endpoint

DELETE /api/v1/data-sources/{data_source_id}

Headers

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Path Parameters

ParameterTypeRequiredDescription
data_source_idintegerYesData source ID

Query Parameters

ParameterTypeRequiredDescription
forcebooleanNoForce hard delete (default: false, performs soft delete)

Response

Success (200)

{
"success": true,
"data": {
"data_source_id": 1,
"deleted_at": "2024-12-01T11:00:00Z"
},
"message": "Data source deleted successfully"
}

Error Codes

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser is not a member of any organization
404NOT_FOUNDData source not found

Features

  • Soft delete by default (sets deleted_at timestamp)
  • Hard delete option with force=true
  • Organization-scoped access control
  • Closes all active connections
  • Cleans up connection pool resources

Important Notes

  • Soft delete (default): Data source is marked as deleted but not removed from database. Can be restored.
  • Hard delete (force=true): Permanently removes data source from database. Cannot be restored.
  • All active connections are closed when data source is deleted
  • Connection pool resources are cleaned up

Example

Soft Delete (Default)

curl -X DELETE "https://api.rivergen.com/api/v1/data-sources/1" \
-H "Authorization: Bearer <access_token>"

Hard Delete

curl -X DELETE "https://api.rivergen.com/api/v1/data-sources/1?force=true" \
-H "Authorization: Bearer <access_token>"