Skip to main content
Gainsight Inc.

Retrieve Deleted Data API

The Cockpit APIs are organized around REST (Representational State Transfer). This article explains to admins the details of how this API can be used to fetch deleted data. 

Introduction

This API helps to retrieve deleted data and improve backup strategies, allowing admins to restore data more efficiently and less resource-intensive. It assures admins that their organizational data is protected from loss or unintentional deletion.
Note: Deleted data is available for retrieval via REST API only for 15 days after deletion.

Authentication

To use this Cockpit APIs, ensure that you generate Access Token:

  • API Authentication: API access is controlled using a unique Access Key. Contact your Gainsight admin to get an access key of the Gainsight tenant to which you want to send REST API requests. For more information on how to generate or share an access key, refer to the Generate API Access Key article.

Once you get the access key, you must pass the access key as part of the request header “accesskey” for all of your API requests into Gainsight. The Access Key does not expire.

Headers

Key Value
Access key For more information on how to generate an access key, refer to the Authentication section.
Content Type JSON

Throttling Limits

API Rate Limit
POST Deleted Data 100 API calls per min / 50,000 API call per day

CTA

Endpoint URL

Endpoint One: /v2/cockpit/cta/deleted/list
Endpoint Two: /v2/cockpit/cta/list (against this endpoint send "includeonlyDeletedRecords":true as part of Body)

Method

Post

Request 

{
    "select": [
        "name",
        "Comments",
        "CompanyId",
        "ModifiedDate"
    ],
    "where": {
        "conditions": [
            {
                "fieldName": "ModifiedDate",
                "literal": "TODAY",
                "alias": "A",
                "operator": "EQ"
            }
        ],
        "expression": "A"
    },
    "pageSize": 100,
    "pageNumber": 1
}

Response 


{
    "result": true,
    "requestId": "63a3e445-2628-491c-96d4-3d7b147493f6",
    "data": [
        {
            "CompanyId": "1P02BVHREJTPN50SVS1B4WZSUAG42IPC4TC1",
            "DueDate": "2024-02-19",
            "EntityType": "COMPANY",
            "Gsid": "1S010QR484IE2OS5VOC2M0MM1UILLQ6EGWKB",
            "IsClosed": false,
            "ModifiedById": "1P019WYNGFXGSE02CREUC1HNPDCVFGFLDS3X",
            "ModifiedDate": "2024-02-05T08:34:35.253Z",
            "Name": "Test Company CTA by KMK",
            "OwnerId": "1P019WYNGFXGSE02CREUC1HNPDCVFGFLDS3X",
            "OwnerId__gr.Email": "sthakuria@gainsight.com",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId": "1I0016MVH7ECQMT12K40VI5F1I95JN2TUI3H",
            "PriorityId__gr.Name": "High",
            "ReasonId": "1I003F6D392Y2KJ97ALK1STOS6L1LBOR8SX0",
            "ReasonId__gr.Name": "Usage Drop",
            "StatusId": "1I0017YS8AFRMU863300P15XSN8EK5G0T0BE",
            "StatusId__gr.Name": "New",
            "TypeId": "1I00650WACZ7F0X9HRSYMBZBFJ74MHB3BR6G",
            "TypeId__gr.Name": "Risk"
        },
        {
            "CompanyId": "1P02BVHREJTPN50SVS1B4WZSUAG42IPC4TC1",
            "DueDate": "2024-02-15",
            "EntityType": "COMPANY",
            "Gsid": "1S010QR484IE2OS5VOOHH3HZ87LCJA4URNJ7",
            "IsClosed": false,
            "ModifiedById": "1P019WYNGFXGSE02CREUC1HNPDCVFGFLDS3X",
            "ModifiedDate": "2024-02-05T08:38:22.234Z",
            "Name": "Test Company CTA KMK 2",
            "OwnerId": "1P019WYNGFXGSE02CREUC1HNPDCVFGFLDS3X",
            "OwnerId__gr.Email": "sthakuria@gainsight.com",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId": "1I0016MVH7ECQMT12K40VI5F1I95JN2TUI3H",
            "PriorityId__gr.Name": "High",
            "ReasonId": "1I003F6D392Y2KJ97AZAYV5SOPE97YQT557Y",
            "ReasonId__gr.Name": "Survey Response",
            "StatusId": "1I0017YS8AFRMU863300P15XSN8EK5G0T0BE",
            "StatusId__gr.Name": "New",
            "TypeId": "1I00650WACZ7F0X9HRSYMBZBFJ74MHB3BR6G",
            "TypeId__gr.Name": "Risk"
        }
    ],
    "pageSize": 100,
    "currentPageNum": 1
}

Task

Endpoint URL

Endpoint One: /v2/cockpit/task/deleted/list

Endpoint Two: /v2/cockpit/task/list (against this endpoint send "includeonlyDeletedRecords":true as part of Body)

Method

Post

Request 

{
    "select": [
        "Gsid",
        "ModifiedDate"
    ],
    "where": {
        "conditions": [
            {
                "fieldName": "ModifiedDate",
                "value": ["2024-02-05", "2024-02-07"],
                "alias": "A",
                "operator": "BTW"
            }
        ],
        "expression": "A"
    },
    "pageSize": 100,
    "pageNumber": 1
}




Response


{
    "result": true,
    "requestId": "0ae8c143-2c6e-48ee-9da1-bd704145d016",
    "data": [
        {
            "ClosedDate": "2024-02-05",
            "DueDate": "2024-02-06",
            "Gsid": "1S03L3JHXBOVGKLESX389VVVDE5514PBVH7P",
            "IsClosed": true,
            "ModifiedDate": "2024-02-05T08:34:03.765Z",
            "Name": "Review NPS comments & research possible source of concern",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Closed",
            "TypeId__gr.Name": "Task"
        },
        {
            "ClosedDate": "2024-02-05",
            "DueDate": "2024-02-12",
            "Gsid": "1S03L3JHXBOVGKLESX3D7VOK132QCAK4HYBN",
            "IsClosed": true,
            "ModifiedDate": "2024-02-05T08:34:03.765Z",
            "Name": "Create internal plan to address customer concern",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Closed",
            "TypeId__gr.Name": "Task"
        },
        {
            "ClosedDate": "2024-02-05",
            "DueDate": "2024-02-07",
            "Gsid": "1S03L3JHXBOVGKLESX4UE2PDJBJ4W4RT1Y4F",
            "IsClosed": true,
            "ModifiedDate": "2024-02-05T08:34:03.765Z",
            "Name": "Contact Detractor to discuss concern & create action plan to correct/resolve",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Closed",
            "TypeId__gr.Name": "Task"
        },
        {
            "DueDate": "2024-02-08",
            "Gsid": "1S03L3JHXBOVGKLESX5ACD70ATEWU4SKQ4RC",
            "IsClosed": false,
            "ModifiedDate": "2024-02-05T08:27:17.168Z",
            "Name": "Check Adoption usage and analytics",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Open",
            "TypeId__gr.Name": "Task"
        },
        {
            "DueDate": "2024-02-19",
            "Gsid": "1S03L3JHXBOVGKLESXHT1WYL2P3KPSYI5YFJ",
            "IsClosed": false,
            "ModifiedDate": "2024-02-05T08:27:17.168Z",
            "Name": "Schedule best practices training",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "Medium",
            "StatusId__gr.Name": "Open",
            "TypeId__gr.Name": "Task"
        },
        {
            "DueDate": "2024-02-19",
            "Gsid": "1S03L3JHXBOVGKLESXHZEXIL0EN8VXPJ3W77",
            "IsClosed": false,
            "ModifiedDate": "2024-02-05T08:27:17.168Z",
            "Name": "Update Product and Sales Teams with customer feedback",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "Medium",
            "StatusId__gr.Name": "Open",
            "TypeId__gr.Name": "Task"
        },
        {
            "ClosedDate": "2024-02-05",
            "DueDate": "2024-02-14",
            "Gsid": "1S03L3JHXBOVGKLESXRM4G5U0SEWT89TI7FS",
            "IsClosed": true,
            "ModifiedDate": "2024-02-05T08:34:03.765Z",
            "Name": "Close loop with Detractor (in email and copy Business Owner)",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Closed",
            "TypeId__gr.Name": "Task"
        },
        {
            "ClosedDate": "2024-02-05",
            "DueDate": "2024-02-06",
            "Gsid": "1S03L3JHXBOVGKLESXYU42AVU45WAU4OUBW5",
            "IsClosed": true,
            "ModifiedDate": "2024-02-05T08:34:03.765Z",
            "Name": "Review survey responses from other respondents",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Closed",
            "TypeId__gr.Name": "Task"
        },
        {
            "DueDate": "2024-02-14",
            "Gsid": "1S03L3JHXBOVGKLESXZOIXEQVMGJM4QGYA0C",
            "IsClosed": false,
            "ModifiedDate": "2024-02-05T08:27:17.168Z",
            "Name": "Schedule call with Admin and/or Power User to identify reason for drop",
            "OwnerId__gr.Name": "Sweta Thakuria",
            "PriorityId__gr.Name": "High",
            "StatusId__gr.Name": "Open",
            "TypeId__gr.Name": "Task"
        }
    ],
    "pageSize": 100,
    "currentPageNum": 1
}

Error Codes 

For the list of error codes associated with the Gainsight Custom Object API, refer to the Error Codes for Company and Custom Object APIs article.

  • Was this article helpful?