2

I've been doing a lot of things lately with Carto, but I haven't been able to find the way to create or upload and delete datasets from my user.

In the API I just can see how to add a dataset to my user, but I cannot eliminate it. I need to do that instead of using the syncing option as i don't have available a CDN or similar and I'm using 8Gb of space in total.

3
  • Click on the dataset, there appears a delete dataset link right under your picture, top right. Commented Jul 15, 2016 at 11:58
  • Thank you Jhon, but I need to do this using the Import API and not doing it manually. I have to import/delete more than 200 datasets. I've 'solved' this question by using the SQL API by making a delete of all the fields and a drop table. But I assume that's not the best way to do it. Commented Jul 15, 2016 at 12:37
  • Sorry, very stupid of me. Yes, I was going to suggest the SQL API -- don't see anything particular wrong with that approach. I have no idea about the appropriate curl command. Commented Jul 15, 2016 at 12:44

1 Answer 1

2

The Import API is the way to upload your files to CARTO in a programatic way, but it does not provide functionality to handle datasets after the import has succeeded.

In order to drop a dataset programatically you can use the CARTO SQL API and perform a drop on your table, as:

DROP tablename

Notice that the DROP statement requires you to be authenticated when you run the request, so you need to add your api key. An example of GET request would be:

https://<username>.carto.com/api/v2/sql?q=DROP <tablename>&api_key=<your_api_key>
1
  • Thank you Iriberri, that's the solution that worked for me. Anyway, this is still not the best solution as the actualization of the datasets you have is slower than the uploading of a new dataset with the same name, so I had to change the name before doing the droptable and it's working correctly after that. Commented Jul 19, 2016 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.