--- title: "Customer Goals APIs" slug: "customer-goals-apis-2" updated: 2026-11-23T12:31:12Z published: 2026-11-23T12:31:12Z canonical: "support.gainsight.com/customer-goals-apis-2" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.gainsight.com/llms.txt > Use this file to discover all available pages before exploring further. # Customer Goals APIs Gainsight NXT This article explains how you can create, update, and fetch Customer Goals using APIs. ## Introduction The Customer Goals API helps you create, update and fetch Customer Goals. These are external APIs that help you integrate with other CRMs to bring data into Gainsight. ## Authorization The API access is controlled using a unique Access Key. You need to contact your Gainsight Admin to get an access key to the Gainsight tenant to which you want to send REST API requests. For more information on how to generate or share an access key, you can refer to the [*Generate REST API Key*](/v1/docs/generate-rest-api-key-1) article. Once you get your access key, you need to pass the access key as part of the request header “accesskey” for all of your API requests into Gainsight. **Note:** The AccessKey does not expire. ## Headers | **Key** | **Value** | | --- | --- | | Accesskey | For more information on how to generate an access key, refer to the [Authorization](/v1/docs/call-to-action-cta-api-documentation#authorization) section. | | Content Type | JSON | ## Throttling Limits | **API** | **Rate Limit** | | --- | --- | | Asynchronous API Calls | 10 calls per hour / 100 per day | | Synchronous API Calls | 100 API calls per min / 50,000 API call per day | ## Create Customer Goals The Create Goal API lets you create new goals. You can either create a goal using the templates from the Goals Library or by passing mandatory fields which include Company, Relationship, Opportunity, Goal Name, and Status. You can also include values for other fields, as per your requirement. **Note:** You can create only one Customer Goal at a time using this API. Bulk creation of customer goals is not supported. ### Method **POST** ### Endpoint URL ```plaintext /v1/csgoal/external/create ``` ### Sample Request Body ```plaintext { "requests": [ { "record": { "Name": "create_test1", "StatusName" : "New", "DueDate": "2022-12-21", "Description": "
Desc 7
Desc 7
Updated Desc
Updated Desc
Desc 7
description
" }, "associateGoalTypes": [ "1I00GO4Q83RGDEM94YM7VTGXMVT1E1JLKNQB" // GSID of goal type ], "associateGoalTypeNames": [ "CP Goal Type" // Goal Type Name ] } ] } ``` #### Sample Success Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "b0f5d246-256b-4ce1-a20a-fc8acbc14039", "data": { "successList": [ { "createdAt": 1738570023841, "deleted": false, "modifiedAt": 1738570023841, "createdBy": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "modifiedBy": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "name": "Metric Name 1", "description": "description
", "unitOfMeasure": "DECIMAL", "displayOrder": 2658, "externalId": null, "active": true, "systemDefined": false, "gsid": "1I0056K976K5AXWOB1PGJTG9R7V2KYR0KBHZ" } ], "failureList": [] }, "message": null, "localizedMessage": null } ``` ### Metric Update API #### Method **PUT** #### Endpoint URL ```plaintext PUT /csgoal/external/metric/ ``` #### Sample Request Body ```plaintext { "requests": [ { "record": { "gsid": "1I0056K976K5AXWOB1PGJTG9R7V2KYR0KBHZ", // GSID of existing metric "name": "Metric Name 1 - updated", "unitOfMeasure": "PERCENTAGE", "description": "Updated description" }, "associateGoalTypes": [ "1I00GO4Q83RGDEM94YUKVBH3OA6UU7RGBRII" // GSIDs of Goal Types to be associated with ], "associateGoalTypeNames": [ "CG4" // Names of Goal Types to be associated with ], "dissociateGoalTypes": [ "1I00GO4Q83RGDEM94Y93I859J3I3KEZXZZF2" // GSIDs of Goal TYpes to be dissociated with ], "dissociateGoalTypeNames": [ "CG1" // Names of Goal Types to be dissociated with ] } ] } ``` #### Sample Success Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "6176221e-f7a8-47b9-acc8-944f7325e9f7", "data": { "successList": [ { "createdAt": 1738570666302, "deleted": false, "modifiedAt": 1738570666302, "createdBy": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "modifiedBy": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "name": "Metric Name 1 - updated", "description": "Updated description", "unitOfMeasure": "PERCENTAGE", "displayOrder": 2659, "externalId": null, "active": true, "systemDefined": false, "gsid": "1I0056K976K5AXWOB1PGJTG9R7V2KYR0KBHZ" } ], "failureList": [] }, "message": null, "localizedMessage": null } ``` #### Metric Error Response ```plaintext { "result": false, "errorCode": "VC_1002", "errorDesc": null, "localizedErrorDesc": null, "requestId": "8813d263-71ff-44a3-8768-bb3e275eb9a5", "data": null, "message": "Unexpected error processing update metric: {}", "localizedMessage": null, "errorInfo": null } ``` ### Metric Delete API #### Method **DELETE** #### Endpoint URL ```plaintext DELETE /csgoal/external/metrics ``` #### Sample Request Body ```plaintext { "recordIds": ["1I0056K976K5AXWOB1NB0L2GCSS77AMROJ8W"] // GSID of the metric to be deleted ``` #### Sample Success Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "60f673bc-da66-4ab6-8cfc-3c4eba8921e3", "data": { "deletedMetrics": [ { "createdAt": 1738570738571, "deleted": true, "modifiedAt": 1738570738571, "createdBy": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "modifiedBy": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "name": "Copy of hi fjnjnrnds", "description": "hi frns
", "unitOfMeasure": "PERCENTAGE", "displayOrder": 16, "externalId": null, "active": true, "systemDefined": false, "gsid": "1I0056K976K5AXWOB1NB0L2GCSS77AMROJ8W" } ] }, "message": null, "localizedMessage": null } ``` #### Error Response Body ```plaintext { "result": false, "errorCode": "VC_8026", "errorDesc": null, "localizedErrorDesc": null, "requestId": "a797130b-5b97-46eb-9c24-7e1062bc5c65", "data": null, "message": "Metric is used in some goals or templates. Cannot delete the metric.", "localizedMessage": null, "errorInfo": { "usageInLayouts": [ "Type1 rel goal type", "CP Goal Type", ], "usageInGoals": [ { "gsid": "1CG0LXVS2HO4Y5ZF1FQZ4XVPN0VE1AJSZ415", "name": "gggg" } ], "hasUsage": true } } ``` ## Goal API This API provides functionality to create, update, read, and delete goal templates. It supports external authentication to integrate seamlessly with external systems. ### Goal Create API #### Method **POST** #### Endpoint URL ```plaintext POST /v1/csgoal/external/create ``` #### Sample Request Body ```plaintext { "requests": [ { "record": { "Name": "Custom Goal 1", // Pass Name of the goal "GoalTypeId": "1I00GO4Q83RGDEM94YM7VTGXMVT1E1JLKNQB", // Pass Goal Type ID "StatusId": "1I005IUOFEZ24SJ62ZSP4PI1BZX88VUL4V1Z", // Status ID "DueDate": "2025-01-07", "Description": "Feb Test Description ", "CompanyName": "IBM", // Company for which the goal is to be created "CompName": "NEW", // custom filed lookup on company:Gsid "cust_string_value__gc": "custom value", // custom field value //"TemplateId": "1CG01SX5TCMHZ0OXX0PXTGFW1BHBFKJT7WCU", // Pass templateID for Goal using template "metricsAssociation": [ { "metricId": "1I0056K976K5AXWOB1XICUZ6DNSP6MZDCWNQ", // Pass GSID of metric linked with Goal Type "baseValue": 10.0, "actualValue": [ { "value": 5.0, "timestamp": "2025-01-04" } ], "targetValue": 8.0 } ], "EntityType": "GLOBAL", "AssociatedWork": [ "1I005G22HP9QX1NRFCZYV81Y6QHH30TMXP49", // GSIDs of associated work "1I005G22HP9QX1NRFC4O3YXDHJ7BZDIAOE4M"] }, "association": { "CTA": [ "1S015065Y1L4AP5SUXPXKGDH9S0CAT75F3CY", // GSIDs of CTAs "1S015065Y1L4AP5SUXAN0N0MYVAFR66HRNQR" ], "SP": [ "1S02JJSBDT2ZT78W7NMT0VBJP3QF725QD8RC", // GSIDs of SPs "1S02JJSBDT2ZT78W7N3SX0J712OA8HOTBSQ7" ] } } ], "lookups": { // Lookup configurations of all the lookup fields "CompanyId": { "fields": { "CompanyName": "Name" }, "lookupField": "Gsid", "objectName": "company", "multiMatchOption": "FIRSTMATCH", "onNoMatch": "ERROR" }, "comp_lookup_gsid__gc": { "fields": { "CompName": "Name" }, "lookupField": "Gsid", "objectName": "company", "multiMatchOption": "FIRSTMATCH", "onNoMatch": "ERROR" } } } ``` #### Sample Response Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "8036a249-8c79-4bd7-9e5f-55721b276011", "data": { "goal": { "comp_lookup_gsid__gc": "1P0275DAZIB1U41FWU0FBY7UJL61TUQZY6UV", "CompanyId": "1P0275DAZIB1U41FWUD895S0FG38OCPH697T", "CreatedById": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "CreatedById__gr": { "Name": "Ujjwal Mahato" }, "CreatedDate": 1738572893155, "CurrencyIsoCode": "USD", "cust_string_value__gc": "custom value", "Description": "Feb Test Description ", "DueDate": "2025-01-07", "EntityType": "GLOBAL", "GoalCategory": "GOAL", "GoalTypeId": "1I00GO4Q83RGDEM94YM7VTGXMVT1E1JLKNQB", "Gsid": "1CG0LXVS2HO4Y5ZF1FQY0E46C0NQWLLWPFX7", "MetricValues": [ { "metricId": "1I0056K976K5AXWOB1XICUZ6DNSP6MZDCWNQ", "goalId": "1CG0LXVS2HO4Y5ZF1FQY0E46C0NQWLLWPFX7", "baseValue": 10.0, "actualValue": [ { "gsid": null, "value": 5.0, "timestamp": "2025-01-04" } ], "targetValue": 8.0, "gsid": "1I0044QAWFWL9VNNWEEFLCSIUTFZ48SJAZEY" } ], "ModifiedById": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "ModifiedById__gr": { "Name": "Ujjwal Mahato" }, "ModifiedDate": 1738572893155, "Name": "Custom Goal 1", "StatusId": "1I005IUOFEZ24SJ62ZSP4PI1BZX88VUL4V1Z", "StatusId__gr": { "Name": "Achieved" } }, "userInfo": { "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT": { "gsid": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "name": "Ujjwal Mahato", "profilePicture": null } } }, "message": null, "localizedMessage": null } ``` ### Goal Update Goal #### Method **PUT** #### Endpoint URL ```plaintext PUT /v1/csgoal/external/update ``` #### Sample Request Body ```plaintext { "requests": [ { "record": { "Gsid": "1CG0LXVS2HO4Y5ZF1F6TV4R7ZV0ZO6MPG6S1", // GSID of existing Goal "Name": "Goal Template Name: Updated", // Updated name "StatusId": "1I005IUOFEZ24SJ62ZSUKB6C3WN620DSIBYT", "DueDate": "2025-01-31", "Description": " Feb : Update 1", "CompName": "NEW", "cust_string_value__gc": " Feb ujjwal custom value - updated", "metricsAssociation": [ // GSIDs of metrics to be associated { "metricId": "1I0056K976K5AXWOB1KBHCAG860QZ6E3JG52", "actualValue": [ { "value": 8.0, "timestamp": "2025-01-10" } ], } ], "metricsDissociation": [ // GSIDs of metrics to be dissociated "1I0056K976K5AXWOB1KBHCAG860QZ6E3JG52", "1I0056K976K5AXWOB1P7YWFJNZOIUXW8YMEQ" ] }, "association": { // GSIDs of CTAs and SPs to be associated "CTA": [ "1S015065Y1L4AP5SUXV96R83SMQ523UNWRXP" ], "SP": [ "1S02JJSBDT2ZT78W7N3V2OYXMWCH2B720L51" ] }, "dissociation": { // GSIDs of CTAs and SPs to be associated "CTA": [ "1S015065Y1L4AP5SUXO3AX169IGVLKKJ5N7R" ], "SP": [ "1S02JJSBDT2ZT78W7N326U5W640ZRK54GLAT" ] } } ], "lookups": { "comp_lookup_gsid__gc": { "fields": { "CompName": "Name" }, "lookupField": "Gsid", "objectName": "company", "multiMatchOption": "FIRSTMATCH", "onNoMatch": "ERROR" } } } ``` #### Sample Response Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "174f41bd-a5ef-4a95-a500-eb1bc383be0d", "data": { "record": { "comp_lookup_gsid__gc": "1P0275DAZIB1U41FWU0FBY7UJL61TUQZY6UV", "cust_string_value__gc": " Feb ujjwal custom value - updated", "Description": " Feb : Update 1", "DueDate": "2025-01-31", "GoalCategory": "GOAL", "Gsid": "1CG0LXVS2HO4Y5ZF1F6TV4R7ZV0ZO6MPG6S1", "ModifiedById": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "ModifiedDate": 1738573668994, "Name": "Goal Template Name: Updated", "StatusId": "1I005IUOFEZ24SJ62ZSUKB6C3WN620DSIBYT" }, "updatedGoals": null, "properties": {} }, "message": null, "localizedMessage": null } ``` ### Goal Fetch API #### Method **POST** #### Endpoint URL ```plaintext POST /v1/csgoal/external/fetch ``` #### Sample Request Body ```plaintext { "select": [ "Name", "Gsid", "StatusId", "cust_string_value__gc", "CurrencyIsoCode" ], "where": { "conditions": [ { "fieldName": "Name", "value": ["barca"], "alias": "A", "operator": "STARTS_WITH" }, { "fieldName": "Name", "value": ["b"], "alias": "B", "operator": "CONTAINS" } ], "expression": "A AND B" }, "pageSize": 10, "pageNumber": 1 } ``` #### Sample Response Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "be36383b-41aa-414b-b078-b4842b926319", "data": { "recordList": [ { "dataList": { "CurrencyIsoCode": "USD", "DueDate": "2025-01-30", "GoalTypeId": "1I00GO4Q83RGDEM94YUKVBH3OA6UU7RGBRII", "Gsid": "1CG0LXVS2HO4Y5ZF1F6YYCF1TN6O5RCW2ZTO", "Name": "barca_template", "StatusId": "1I005IUOFEZ24SJ62ZSP4PI1BZX88VUL4V1Z", "cust_string_value__gc": "hello" }, "associatedCTAs": [], "associatedSPs": [ { "gsid": "1S02JJSBDT2ZT78W7NL2NR8BXMXALV76JBSC", "name": "barca_sp 1I00GO4Q83RGDEM94YUKVBH3OA6UU7RGBRII", "entityType": "COMPANY", "ownerId": "1P01J0CQPQSRP90S3XLLTAL1EG7F0GQ6SFGX", "statusId": "1I004Y368TQW84KNMBVMAMEBL1IOFF9APWGI", "dueDate": "2025-01-31 11:30:00", "closedCtaCount": null } ] }, { "dataList": { "CurrencyIsoCode": "USD", "GoalTypeId": "1I00GO4Q83RGDEM94YUKVBH3OA6UU7RGBRII", "Gsid": "1CG0LXVS2HO4Y5ZF1FJINHVV1BOPDPEGV3J4", "Name": "Barca custom goal ", "StatusId": "1I005IUOFEZ24SJ62ZSUKB6C3WN620DSIBYT", "cust_string_value__gc": "hello" }, "associatedCTAs": [], "associatedSPs": [ { "gsid": "1S02JJSBDT2ZT78W7NL2NR8BXMXALV76JBSC", "name": "barca_sp 1I00GO4Q83RGDEM94YUKVBH3OA6UU7RGBRII", "entityType": "COMPANY", "ownerId": "1P01J0CQPQSRP90S3XLLTAL1EG7F0GQ6SFGX", "statusId": "1I004Y368TQW84KNMBVMAMEBL1IOFF9APWGI", "dueDate": "2025-01-31 11:30:00", "closedCtaCount": null } ] }, { "dataList": { "CurrencyIsoCode": "USD", "DueDate": "2025-01-30", "GoalTypeId": "1I00GO4Q83RGDEM94YUKVBH3OA6UU7RGBRII", "Gsid": "1CG0LXVS2HO4Y5ZF1FLUUZU35FSKQ35Y65OE", "Name": "barca_template", "StatusId": "1I005IUOFEZ24SJ62ZSP4PI1BZX88VUL4V1Z", "cust_string_value__gc": "hello" }, "associatedCTAs": [], "associatedSPs": [ { "gsid": "1S02JJSBDT2ZT78W7N8GO7DU8XPA0RUBHPZ0", "name": "Acc Rel Assoc SP 2", "entityType": "RELATIONSHIP", "ownerId": "1P01J0CQPQSRP90S3XREZGN79WR84S54PAPT", "statusId": "1I004Y368TQW84KNMBX5PGC6I51VPOBJRULN", "dueDate": "2025-01-31 11:30:00", "closedCtaCount": null } ] } ] }, "message": null, "localizedMessage": null } ``` ### GET Picklist #### Method #### Endpoint URL ```plaintext /v1/csgoal/external/admin/picklist ``` #### Sample Request Body ```plaintext { "entityIds": ["COMPANY"], // Pass COMAPANY, RELATIONSHIP_TYPE_IDs, ALL_ENTITY or any cobination "active": false, // Pass true for all active picklists "includeMetrics": false, // Pass true for metrics details "includeChildPicklist": true, // Pass true for including status details "picklistCategory":"GOAL_TYPE" //cPass GOAL_TYPE (default) or GOAL_STATUS } ``` #### Sample Response Body ```plaintext { "result": true, "errorCode": null, "errorDesc": null, "localizedErrorDesc": null, "requestId": "08ae7618-07b4-4657-808d-7d5463a231fb", "data": { "picklists": [ { "gsid": "1I00GO4Q83RGDEM94YVKZHCWLIHJNZ6NBPWE", "name": "Stage xorg validate", "color": "#98E7B1", "picklistCategory": "GOAL_TYPE", "displayOrder": 4, "active": true, "openStatusType": false, "recurring": false, "systemDefined": false, "associationDetails": { "autoAssignFutureAssociationIds": true, "associationCategory": "ENTITY", "associationIds": [ "COMPANY" ] }, "childPicklistIds": {} }, { "gsid": "1I00GO4Q83RGDEM94YFZF1JII9BB5FOAUPUA", "name": "new goal type with metrics", "color": "#98E7B1", "picklistCategory": "GOAL_TYPE", "displayOrder": 3, "active": true, "openStatusType": false, "recurring": false, "systemDefined": false, "associationDetails": { "autoAssignFutureAssociationIds": true, "associationCategory": "ENTITY", "associationIds": [ "ALL_ENTITY" ] }, "childPicklistIds": {} }, { "gsid": "1I00GO4Q83RGDEM94Y417YFL8IB9L9R5WO99", "name": "Default", "systemName": "DEFAULT_GOAL_TYPE", "color": "#98E7B1", "picklistCategory": "GOAL_TYPE", "displayOrder": 1, "active": true, "openStatusType": false, "recurring": false, "systemDefined": true, "associationDetails": { "autoAssignFutureAssociationIds": true, "associationCategory": "ENTITY", "associationIds": [ "ALL_ENTITY" ] }, "childPicklistIds": {} }, { "gsid": "1I00GO4Q83RGDEM94YIQ4HZ6OZGYP2QTVG9K", "name": "new goalc hecl", "color": "#98E7B1", "picklistCategory": "GOAL_TYPE", "displayOrder": 5, "active": true, "openStatusType": false, "recurring": false, "systemDefined": false, "associationDetails": { "autoAssignFutureAssociationIds": true, "associationCategory": "ENTITY", "associationIds": [ "ALL_ENTITY" ] }, "childPicklistIds": {} } ], "childPicklists": [], "metrics": null }, "message": null, "localizedMessage": null ``` ## Error Codes | **Error code** | **Error Message** | **Reason** | **HTTP Status Code** | | --- | --- | --- | --- | | 8001 | CTA_RECORD_EMPTY | CTA set provided is empty | 400 | | 8002 | SP_RECORD_EMPTY | Success Plan set provided is empty | 400 | | 8007 | INVALID_PAGE_REQUEST | Invalid page request | 400 | | 8008 | INVALID_LOOKUP_CONFIG | Lookup Error | 400 | | 8009 | INVALID_FIELD | Invalid field in select clause | 400 | | 8010 | INVALID_STATUS_NAME | Invalid status name provided | 400 |