[{"data":1,"prerenderedAt":633},["ShallowReactive",2],{"navigation_docs":3,"-guides-using-the-api-send-metric-values":217,"-guides-using-the-api-send-metric-values-surround":628},[4,55],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":12},"Guides","i-nucleo-book","\u002Fguides","1.guides",[10,21,41],{"title":11,"icon":12,"path":13,"stem":14,"children":15,"page":12},"Getting started",false,"\u002Fguides\u002Fgetting-started","1.guides\u002F1.getting-started",[16],{"title":17,"path":18,"stem":19,"icon":20},"Introduction","\u002Fguides\u002Fgetting-started\u002Fintroduction","1.guides\u002F1.getting-started\u002F1.introduction","i-nucleo-home",{"title":22,"icon":12,"path":23,"stem":24,"children":25,"page":12},"Connect an AI app","\u002Fguides\u002Fconnect-ai","1.guides\u002F2.connect-ai",[26,31,36],{"title":27,"path":28,"stem":29,"icon":30},"Connect Claude","\u002Fguides\u002Fconnect-ai\u002Fconnect-claude","1.guides\u002F2.connect-ai\u002F1.connect-claude","i-nucleo-plug",{"title":32,"path":33,"stem":34,"icon":35},"What it can see","\u002Fguides\u002Fconnect-ai\u002Fwhat-it-can-see","1.guides\u002F2.connect-ai\u002F2.what-it-can-see","i-nucleo-eye",{"title":37,"path":38,"stem":39,"icon":40},"Manage connections","\u002Fguides\u002Fconnect-ai\u002Fmanage-connections","1.guides\u002F2.connect-ai\u002F3.manage-connections","i-nucleo-sliders",{"title":42,"icon":12,"path":43,"stem":44,"children":45,"page":12},"Using the API","\u002Fguides\u002Fusing-the-api","1.guides\u002F3.using-the-api",[46,50],{"title":47,"path":48,"stem":49,"icon":35},"Read your data","\u002Fguides\u002Fusing-the-api\u002Fread-your-data","1.guides\u002F3.using-the-api\u002F1.read-your-data",{"title":51,"path":52,"stem":53,"icon":54},"Send metric values","\u002Fguides\u002Fusing-the-api\u002Fsend-metric-values","1.guides\u002F3.using-the-api\u002F2.send-metric-values","i-nucleo-chart-activity",{"title":56,"path":57,"stem":58,"children":59,"icon":216},"API Reference","\u002Fapi-reference","2.api-reference\u002F01.index",[60,62,67,72,77,90,114,151,161,186,201],{"title":11,"path":57,"stem":58,"icon":61},"i-nucleo-rocket",{"title":63,"path":64,"stem":65,"icon":66},"Authentication","\u002Fapi-reference\u002Fauthentication","2.api-reference\u002F02.authentication","i-nucleo-key",{"title":68,"path":69,"stem":70,"icon":71},"Errors and limits","\u002Fapi-reference\u002Ferrors","2.api-reference\u002F03.errors","i-nucleo-triangle-warning",{"title":73,"path":74,"stem":75,"icon":76},"Pagination","\u002Fapi-reference\u002Fpagination","2.api-reference\u002F04.pagination","i-nucleo-check-list",{"title":78,"icon":12,"path":79,"stem":80,"children":81,"page":12},"Programs","\u002Fapi-reference\u002Fprograms","2.api-reference\u002F05.programs",[82],{"title":83,"path":84,"stem":85,"badge":86},"List programs","\u002Fapi-reference\u002Fprograms\u002Flist-programs","2.api-reference\u002F05.programs\u002F1.list-programs",{"label":87,"color":88,"variant":89},"GET","success","subtle",{"title":91,"icon":12,"path":92,"stem":93,"children":94,"page":12},"Employees","\u002Fapi-reference\u002Femployees","2.api-reference\u002F06.employees",[95,100,107],{"title":96,"path":97,"stem":98,"badge":99},"List employees","\u002Fapi-reference\u002Femployees\u002Flist-employees","2.api-reference\u002F06.employees\u002F1.list-employees",{"label":87,"color":88,"variant":89},{"title":101,"path":102,"stem":103,"badge":104},"Create an employee","\u002Fapi-reference\u002Femployees\u002Fcreate-employee","2.api-reference\u002F06.employees\u002F2.create-employee",{"label":105,"color":106,"variant":89},"POST","info",{"title":108,"path":109,"stem":110,"badge":111},"Update an employee","\u002Fapi-reference\u002Femployees\u002Fupdate-employee","2.api-reference\u002F06.employees\u002F3.update-employee",{"label":112,"color":113,"variant":89},"PATCH","warning",{"title":115,"icon":12,"path":116,"stem":117,"children":118,"page":12},"Groups","\u002Fapi-reference\u002Fgroups","2.api-reference\u002F07.groups",[119,124,129,134,141,146],{"title":120,"path":121,"stem":122,"badge":123},"List groups","\u002Fapi-reference\u002Fgroups\u002Flist-groups","2.api-reference\u002F07.groups\u002F1.list-groups",{"label":87,"color":88,"variant":89},{"title":125,"path":126,"stem":127,"badge":128},"Create a group","\u002Fapi-reference\u002Fgroups\u002Fcreate-group","2.api-reference\u002F07.groups\u002F2.create-group",{"label":105,"color":106,"variant":89},{"title":130,"path":131,"stem":132,"badge":133},"Update a group","\u002Fapi-reference\u002Fgroups\u002Fupdate-group","2.api-reference\u002F07.groups\u002F3.update-group",{"label":112,"color":113,"variant":89},{"title":135,"path":136,"stem":137,"badge":138},"Archive a group","\u002Fapi-reference\u002Fgroups\u002Farchive-group","2.api-reference\u002F07.groups\u002F4.archive-group",{"label":139,"color":140,"variant":89},"DELETE","error",{"title":142,"path":143,"stem":144,"badge":145},"Add employees to groups","\u002Fapi-reference\u002Fgroups\u002Fadd-employees-to-groups","2.api-reference\u002F07.groups\u002F5.add-employees-to-groups",{"label":105,"color":106,"variant":89},{"title":147,"path":148,"stem":149,"badge":150},"Remove employees from groups","\u002Fapi-reference\u002Fgroups\u002Fremove-employees-from-groups","2.api-reference\u002F07.groups\u002F6.remove-employees-from-groups",{"label":105,"color":106,"variant":89},{"title":152,"icon":12,"path":153,"stem":154,"children":155,"page":12},"Rewards","\u002Fapi-reference\u002Frewards","2.api-reference\u002F08.rewards",[156],{"title":157,"path":158,"stem":159,"badge":160},"List upcoming rewards","\u002Fapi-reference\u002Frewards\u002Flist-upcoming-rewards","2.api-reference\u002F08.rewards\u002F1.list-upcoming-rewards",{"label":87,"color":88,"variant":89},{"title":162,"icon":12,"path":163,"stem":164,"children":165,"page":12},"Insights","\u002Fapi-reference\u002Finsights","2.api-reference\u002F09.insights",[166,171,176,181],{"title":167,"path":168,"stem":169,"badge":170},"Get coverage gaps","\u002Fapi-reference\u002Finsights\u002Fget-coverage-gaps","2.api-reference\u002F09.insights\u002F1.get-coverage-gaps",{"label":87,"color":88,"variant":89},{"title":172,"path":173,"stem":174,"badge":175},"List coverage gap employees","\u002Fapi-reference\u002Finsights\u002Flist-coverage-gap-employees","2.api-reference\u002F09.insights\u002F2.list-coverage-gap-employees",{"label":87,"color":88,"variant":89},{"title":177,"path":178,"stem":179,"badge":180},"Get quiet employees","\u002Fapi-reference\u002Finsights\u002Fget-quiet-employees","2.api-reference\u002F09.insights\u002F3.get-quiet-employees",{"label":87,"color":88,"variant":89},{"title":182,"path":183,"stem":184,"badge":185},"Get program review","\u002Fapi-reference\u002Finsights\u002Fget-program-review","2.api-reference\u002F09.insights\u002F4.get-program-review",{"label":87,"color":88,"variant":89},{"title":187,"icon":12,"path":188,"stem":189,"children":190,"page":12},"Metrics","\u002Fapi-reference\u002Fmetrics","2.api-reference\u002F10.metrics",[191,196],{"title":192,"path":193,"stem":194,"badge":195},"Send a metric value","\u002Fapi-reference\u002Fmetrics\u002Fsend-metric-value","2.api-reference\u002F10.metrics\u002F1.send-metric-value",{"label":105,"color":106,"variant":89},{"title":197,"path":198,"stem":199,"badge":200},"Get a metric value","\u002Fapi-reference\u002Fmetrics\u002Fget-metric-value","2.api-reference\u002F10.metrics\u002F2.get-metric-value",{"label":87,"color":88,"variant":89},{"title":202,"icon":12,"path":203,"stem":204,"children":205,"page":12},"System","\u002Fapi-reference\u002Fsystem","2.api-reference\u002F11.system",[206,211],{"title":207,"path":208,"stem":209,"badge":210},"Check API health","\u002Fapi-reference\u002Fsystem\u002Fhealth","2.api-reference\u002F11.system\u002F1.health",{"label":87,"color":88,"variant":89},{"title":212,"path":213,"stem":214,"badge":215},"Get the OpenAPI document","\u002Fapi-reference\u002Fsystem\u002Fopenapi","2.api-reference\u002F11.system\u002F2.openapi",{"label":87,"color":88,"variant":89},"i-nucleo-code",{"id":218,"title":51,"body":219,"description":621,"extension":622,"links":623,"meta":624,"navigation":625,"path":52,"seo":626,"stem":53,"__hash__":627},"docs\u002F1.guides\u002F3.using-the-api\u002F2.send-metric-values.md",{"type":220,"value":221,"toc":613},"minimark",[222,226,231,239,278,282,293,405,416,420,423,438,442,445,448,452,462,525,529,545,603,609],[223,224,225],"p",{},"Goal programs reward people for reaching a target, such as closing 50 deals. Your systems report each person's progress, and Teambrite works out who has earned a reward.",[227,228,230],"h2",{"id":229},"before-you-start","Before you start",[223,232,233,234,238],{},"You need a key with the ",[235,236,237],"code",{},"metric:write"," scope, and two IDs:",[240,241,242,263],"ul",{},[243,244,245,249,250,253,254,258,259,262],"li",{},[246,247,248],"strong",{},"The employee's ID,"," which starts with ",[235,251,252],{},"emp_",". ",[255,256,257],"a",{"href":97},"Find it"," by filtering on their work email or the ID your own system uses for them, which needs a key with ",[235,260,261],{},"employee:read",". It's also in the address of their profile in the dashboard.",[243,264,265,268,269,272,273,277],{},[246,266,267],{},"The metric's key,"," in ",[235,270,271],{},"snake_case",". The dashboard doesn't show these yet, so email ",[255,274,276],{"href":275},"mailto:support@teambrite.com","support@teambrite.com"," and we'll send you yours.",[227,279,281],{"id":280},"send-the-full-value-each-time","Send the full value each time",[223,283,284,285,288,289,292],{},"Every value belongs to one person and is never added up across people. If someone has closed 12 deals, send ",[235,286,287],{},"12",", not ",[235,290,291],{},"1",".",[294,295,300],"pre",{"className":296,"code":297,"language":298,"meta":299,"style":299},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST https:\u002F\u002Fapi.teambrite.com\u002Fv1\u002Fmetrics \\\n  -H \"Authorization: Bearer $TEAMBRITE_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"employeeId\": \"emp_LssEG8crOK3xrxCVx1nS6jy7\",\n    \"metricKey\": \"sales_closed\",\n    \"value\": 12,\n    \"idempotencyKey\": \"crm-event-8f3a2c71\"\n  }'\n","bash","",[235,301,302,325,346,360,372,378,384,390,396],{"__ignoreMap":299},[303,304,307,311,315,318,321],"span",{"class":305,"line":306},"line",1,[303,308,310],{"class":309},"sBMFI","curl",[303,312,314],{"class":313},"sfazB"," -X",[303,316,317],{"class":313}," POST",[303,319,320],{"class":313}," https:\u002F\u002Fapi.teambrite.com\u002Fv1\u002Fmetrics",[303,322,324],{"class":323},"sTEyZ"," \\\n",[303,326,328,331,335,338,341,344],{"class":305,"line":327},2,[303,329,330],{"class":313},"  -H",[303,332,334],{"class":333},"sMK4o"," \"",[303,336,337],{"class":313},"Authorization: Bearer ",[303,339,340],{"class":323},"$TEAMBRITE_API_KEY",[303,342,343],{"class":333},"\"",[303,345,324],{"class":323},[303,347,349,351,353,356,358],{"class":305,"line":348},3,[303,350,330],{"class":313},[303,352,334],{"class":333},[303,354,355],{"class":313},"Content-Type: application\u002Fjson",[303,357,343],{"class":333},[303,359,324],{"class":323},[303,361,363,366,369],{"class":305,"line":362},4,[303,364,365],{"class":313},"  -d",[303,367,368],{"class":333}," '",[303,370,371],{"class":313},"{\n",[303,373,375],{"class":305,"line":374},5,[303,376,377],{"class":313},"    \"employeeId\": \"emp_LssEG8crOK3xrxCVx1nS6jy7\",\n",[303,379,381],{"class":305,"line":380},6,[303,382,383],{"class":313},"    \"metricKey\": \"sales_closed\",\n",[303,385,387],{"class":305,"line":386},7,[303,388,389],{"class":313},"    \"value\": 12,\n",[303,391,393],{"class":305,"line":392},8,[303,394,395],{"class":313},"    \"idempotencyKey\": \"crm-event-8f3a2c71\"\n",[303,397,399,402],{"class":305,"line":398},9,[303,400,401],{"class":313},"  }",[303,403,404],{"class":333},"'\n",[223,406,407,408,411,412,415],{},"A ",[235,409,410],{},"202"," means the value has been recorded safely, and answers with an ",[235,413,414],{},"id"," for this reading. Checking it against your programs happens afterwards.",[227,417,419],{"id":418},"how-values-are-applied","How values are applied",[223,421,422],{},"Each value is checked by itself, in the order Teambrite receives them, and the program's dates are compared with when it arrived.",[240,424,425,428,431],{},[243,426,427],{},"A program pays each person once, the first time any value reaches its target.",[243,429,430],{},"A later, lower value doesn't undo a reward. Neither does a counter going back to zero, and an older value arriving late doesn't overwrite a newer one.",[243,432,433,434,437],{},"To correct a value, send the right one with a new ",[235,435,436],{},"idempotencyKey",". A reward that has already been earned stays earned.",[227,439,441],{"id":440},"choose-an-idempotency-key","Choose an idempotency key",[223,443,444],{},"Use something that names this one reading, like the ID of the event in your system. A key based on the person and the month doesn't work, because the total changes during the month and a key can only ever mean one value.",[223,446,447],{},"Keys are unique across your whole company, whichever API key sent them, and Teambrite never forgets one.",[227,449,451],{"id":450},"retry-safely","Retry safely",[223,453,454,455,458,459,461],{},"If you get a ",[235,456,457],{},"500"," or lose the response, send the same request again with the same ",[235,460,436],{},". A person's value is only recorded once, even if two copies arrive at the same moment.",[463,464,465,478],"table",{},[466,467,468],"thead",{},[469,470,471,475],"tr",{},[472,473,474],"th",{},"You send",[472,476,477],{},"You get",[479,480,481,490,511],"tbody",{},[469,482,483,487],{},[484,485,486],"td",{},"A new key",[484,488,489],{},"The value is recorded",[469,491,492,495],{},[484,493,494],{},"A used key with the same employee, metric and value",[484,496,497,499,500,503,504,506,507,510],{},[235,498,410],{}," with ",[235,501,502],{},"duplicate: true",", the original ",[235,505,414],{}," and ",[235,508,509],{},"acceptedAt",", and nothing changes",[469,512,513,516],{},[484,514,515],{},"A used key with anything different",[484,517,518,521,522],{},[235,519,520],{},"409"," with the code ",[235,523,524],{},"METRIC_IDEMPOTENCY_CONFLICT",[227,526,528],{"id":527},"see-what-happened","See what happened",[223,530,531,532,534,535,537,538,541,542,292],{},"Pass the ",[235,533,414],{}," to ",[255,536,197],{"href":198}," to see how it went. Keep checking until ",[235,539,540],{},"status"," is ",[235,543,544],{},"completed",[463,546,547,558],{},[466,548,549],{},[469,550,551,555],{},[472,552,553],{},[235,554,540],{},[472,556,557],{},"What it means",[479,559,560,570,580,593],{},[469,561,562,567],{},[484,563,564],{},[235,565,566],{},"pending",[484,568,569],{},"Recorded, and waiting to be checked",[469,571,572,577],{},[484,573,574],{},[235,575,576],{},"processing",[484,578,579],{},"Being checked against your programs",[469,581,582,586],{},[484,583,584],{},[235,585,544],{},[484,587,588,589,592],{},"Checked. ",[235,590,591],{},"programs"," says what each one decided",[469,594,595,600],{},[484,596,597],{},[235,598,599],{},"failed",[484,601,602],{},"A problem on our side. Teambrite keeps retrying for 24 hours, so don't send it again",[223,604,605,606,608],{},"See ",[255,607,192],{"href":193}," for every field and status.",[610,611,612],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":299,"searchDepth":327,"depth":327,"links":614},[615,616,617,618,619,620],{"id":229,"depth":327,"text":230},{"id":280,"depth":327,"text":281},{"id":418,"depth":327,"text":419},{"id":440,"depth":327,"text":441},{"id":450,"depth":327,"text":451},{"id":527,"depth":327,"text":528},"Report each person's progress so goal programs can reward them.","md",null,{},{"icon":54},{"title":51,"description":621},"wBsdP7PFE0NNlmQpyhkSDdz-wOUW3MofGtdw5K23bXk",[629,631],{"title":47,"path":48,"stem":49,"description":630,"icon":35,"children":-1},"Pull your programs, employees and insights into your own systems.",{"title":11,"path":57,"stem":58,"description":632,"icon":61,"children":-1},"Make your first request to the Teambrite API.",1794422645403]