{"id":17662,"date":"2021-07-13T12:03:32","date_gmt":"2021-07-13T09:03:32","guid":{"rendered":"https:\/\/trueconf.com/blog\/?p=17662"},"modified":"2025-11-13T18:51:24","modified_gmt":"2025-11-13T15:51:24","slug":"how-to-delete-past-meetings-automatically","status":"publish","type":"post","link":"https:\/\/trueconf.com/blog\/knowledge-base\/how-to-delete-past-meetings-automatically","title":{"rendered":"Automatic deletion of conferences with TrueConf API"},"content":{"rendered":"<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">Starting from the version <a href=\"https:\/\/trueconf.com\/products\/changelog.html#server-5-3-0\" target=\"_blank\" rel=\"noopener\">5.3.0<\/a>, TrueConf Server and TrueConf Server Free  support automatic deletion of the conferences that have already ended. To learn more about this way of deleting events, refer to the <a href=\"https:\/\/trueconf.com\/docs\/server\/en\/admin\/conferences\/#automatic-conference-deletion\" target=\"_blank\" rel=\"noopener\">TrueConf Server administrator guide<\/a>. This article will show how you can do it with the help of a program which is run on a recurring  basis and which uses <a href=\"https:\/\/developers.trueconf.com\/api\/server\" target=\"_blank\" rel=\"noopener\">TrueConf Server API<\/a>.<\/p>\n<div class=\"accent-note accent-note--line ui-mb-sm-1 ui-mt-xs-3\">\n<p class=\"primary-medium-text\">To see the full list of TrueConf Server API features, please <a href=\"https:\/\/trueconf.com\/blog\/knowledge-base\/how-to-get-started-with-trueconf-api.html\" target=\"_blank\" rel=\"noopener\">read our documentation<\/a>.<\/p>\n<\/div>\n<h2 id=\"desc\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Problem description<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">If you organize and schedule a lot of meetings, you may need to clear past conferences (e.g. those that have finished for more than a month).<\/p>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">However, you may not simply delete all the meetings that are not launched (i.e. \u201cstopped\u201d), because all currently inactive conferences (even those that have not been started yet) are assigned with a \u201cstopped\u201d status. Moreover, you have to exclude the conferences with an automatic start schedule, e.g., weekly recurring meetings, from the removal list.<\/p>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">Thus, you need to delete scheduled one-time events which have finished for a certain number of days.<\/p>\n<div class=\"accent-note accent-note--line ui-mb-sm-1 ui-mt-xs-3\">\n<p class=\"primary-medium-text\">To see a code example of this case, please visit <a href=\"https:\/\/github.com\/TrueConf\/TrueConf-Server-API-examples\" target=\"_blank\" rel=\"noopener\">our GitHub<\/a>.<\/p>\n<\/div>\n<h2 id=\"step-o\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 1. Determining a specific date and time for removing the meetings<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">You need to choose a date: all meetings that have been created before the specified date will be deleted. In order to determine this date you should subtract the required number of days from the current date. The result should be converted in <a href=\"https:\/\/www.unixtimestamp.com\/\" target=\"_blank\" rel=\"noopener\">Unix Timestamp<\/a> format. For instance, if you need to remove the \u0441onferences that have finished by June 1, 2021, 9 p.m. UTC you will get 1622494800.<\/p>\n<h2 id=\"step-t\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 2. Getting conference list<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">You can obtain a list of conferences by using the <a href=\"https:\/\/developers.trueconf.com\/api\/server\/#api-Conferences-GetConferenceList\" target=\"_blank\" rel=\"noopener\">Get Conference List<\/a> method and specifying the additional parameter <code>state=stopped<\/code>.<\/p>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">As a result you will get JSON with <a href=\"https:\/\/developers.trueconf.ru\/api\/server\/#api-Objects-Conference\" target=\"_blank\" rel=\"noopener\">Conference object<\/a> list.<\/p>\n<h2 id=\"tags\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Working with the <code>tags<\/code> parameter<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">If you are creating a conference with the help of the <a href=\"https:\/\/developers.trueconf.com\/api\/server\/#api-Conferences-CreateConference\" target=\"_blank\" rel=\"noopener\">Create Conference<\/a> API request and do not want to delete all conferences that have already ended, you can reduce the size of the list received during Step 2. To do it, mark the conferences that have to be deleted with a certain tag. For example, you can set the parameter <code>\"tags\":[\"delete\"]<\/code>. In this case you will be able to filter the list of ended conferences by using the <code>tag=delete<\/code> parameter in your GET request.<\/p>\n<pre class=\"lang:default decode:true \" >https:\/\/server.example.com\/\/api\/v3.11\/conferences?tag=delete<\/pre>\n<h2 id=\"step-th\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 3. Searching for the conferences to be deleted<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">For each conference from the conference object list you should do the following:<\/p>\n<ul class=\"ui-list ui-list--medium ui-mb-sm-1 ui-mt-xs-3\">\n<li class=\"ui-list__item ui-list__item--disc\">Check a conference schedule type by using <a href=\"https:\/\/developers.trueconf.com\/api\/server\/#api-Objects-Schedule\" target=\"_blank\" rel=\"noopener\">Schedule object<\/a> (it has to be a one-time meeting <code>\"type\":1<\/code>).<\/li>\n<li class=\"ui-list__item ui-list__item--disc\">If the conference ending time which equals its starting time <code>start_time<\/code> plus its duration <code>duration<\/code> is less than you get in <a href=\"#Step_1_Determining_a_specific_date_and_time_for_removing_the_meetings\">step 1<\/a>, save <a href=\"https:\/\/trueconf.com\/blog\/wiki\/conference-id\" target=\"_blank\" rel=\"noopener\">its ID<\/a> and do the next step.<\/li>\n<\/ul>\n<h2 id=\"step-f\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 4. Deleting a conference<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">Delete a conference by using DELETE-request <a href=\"https:\/\/developers.trueconf.com\/api\/server\/#api-Conferences-DeleteConference\" target=\"_blank\" rel=\"noopener\">Delete Conference<\/a>, where you should specify its ID.<\/p>\n<p class=\"primary-medium-text ui-mb-sm-1 ui-mt-xs-3\">If you want to use this method for virtual rooms, you need to mark a conference with a tag when creating or editing this event (refer to the <a href=\"#tags\">description of the tags parameter<\/a>). Later it will be possible to delete all conferences from the received list if they were marked with this tag.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting from the version 5.3.0, TrueConf Server and TrueConf Server Free support automatic deletion of the conferences that have already ended. To learn more about this way of deleting events, refer to the TrueConf Server administrator guide. This article will show how you can do it with the help of a program which is run [&hellip;]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[260],"tags":[246],"class_list":["post-17662","post","type-post","status-publish","format-standard","hentry","category-knowledge-base","tag-api-and-sdk","wpautop"],"_links":{"self":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/17662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/comments?post=17662"}],"version-history":[{"count":5,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/17662\/revisions"}],"predecessor-version":[{"id":40498,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/17662\/revisions\/40498"}],"wp:attachment":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/media?parent=17662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/categories?post=17662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/tags?post=17662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}