Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Retention

    Read the retention settings that apply to your account.

    Retention is an account setting, not a universal duration. Read rawDays and aggregateDays before choosing a history interval or designing an export schedule. The response describes the settings active for the authenticated company.

    curl

    curl "$RDC_BASE_URL/iot/v1/tags/retention" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/iot/v1/tags/retention`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/iot/v1/tags/retention',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/iot/v1/tags/retention');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/iot/v1/tags/retention");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "rawDays": 30,
      "aggregateDays": 365
    }

    Export needed raw readings while they remain within the configured window. An empty historical interval does not prove that no measurements were ever collected; check the retention window and tag quality.