Delete a datasource
The workflow for deleting and cleaning up a datasource includes the following sequence of REST API requests.
- Delete a datasource
DELETE /api/datasources/{datasourceId}
- Delete a datasource connection
DELETE /api/datasources/connections/{connectionId}
- Delete a datasource login
DELETE /api/datasources/logins/{loginId}
You can try out this workflow at REST API Playground.
Learn more about MicroStrategy REST API Playground here.
Delete a datasource
Get the authorization token needed to execute the request with POST /api/auth/login.
You can obtain the datasource ID from searching for the datasource by name with the endpoint GET /api/datasources
.
Endpoint: DELETE /api/datasources/{datasourceId}
Sample Request Header:
"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch"
Sample Request Body: Empty
Sample Curl:
curl --location -g --request DELETE 'https://demo.microstrategy.com/MicroStrategyLibrary/api/datasources/604F7EB2AF4E8CCB93F0C48071A3F466' \
--header 'X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch'
Sample Response Body: Empty
Sample Response Code: 204 (A database source is deleted successfully.)
Delete a datasource connection
Get the authorization token needed to execute the request with POST /api/auth/login.
You can obtain the connection ID from searching for datasource connections with the endpoint GET /api/datasources/connections
.
Endpoint: DELETE /api/datasources/connections/{connectionId}
Sample Request Header:
"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch"
Sample Request Body: Empty
Sample Curl:
curl --location -g --request DELETE 'https://demo.microstrategy.com/MicroStrategyLibrary/api/datasources/connections/CDCBE48C1342CBC68FCE4393AF33A1CC' \
--header 'X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch' \
Sample Response Body: Empty
Sample Response Code: 204 (Datasource connection is deleted successfully.)
Delete a datasource login
Get the authorization token needed to execute the request with POST /api/auth/login.
You can obtain the login ID from viewing datasource logins with the endpoint GET /api/datasources/logins
.
Endpoint: DELETE /api/datasources/{datasourceId}
Sample Request Header:
"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch"
Sample Request Body: Empty
Sample Curl:
curl --location -g --request DELETE 'https://demo.microstrategy.com/MicroStrategyLibrary/api/datasources/logins/34B407AA6B43C17B8286A3AEEA775DB3' \
--header 'X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch' \
Sample Response Body: Empty
Sample Response Code: 204 (Datasource login is deleted successfully.)