Skip to main content

Overview

KnowKR provides a powerful API that allows you to automate updates to your OKRs. Although there isn’t a direct integration between KnowKR and Zapier, you can still utilize Zapier’s “Code by Zapier” action to update your OKRs within Zapier.

Step-by-Step Guide

1

Obtain Your KnowKR API Key

  1. Log in to your KnowKR account.
  2. Click on your profile icon in the top left corner and select “API Keys”.
  3. Click the “Create API Key” button, name your key, and click “Generate Key”.
  4. Copy your API key and keep it secure as it grants access to your account.
2

Identify the Measurement Value in Your Zap

  1. Set up your Zap (in Zapier) to capture the necessary measurement value from an app or service in your workflow.
  2. Ensure the value is a number and is available as a data variable for use in subsequent steps.
3

Add a "Code by Zapier" Action

  1. In your Zap, add an action step and search for “Code by Zapier.”
  2. Select the Run JavaScript option.
  3. Configure the following settings:
    • Input Data:
      • id: The key result id (you can get this from selecting a key result on the KnowKR dashboard)
      • value: The measurement value you captured in the previous step.
      • token: Your KnowKR API key obtained in the first step.
    • Code: Use the provided code snippet to update the measurement value for your key result.
      await fetch('https://app.knowkr.com/api/key-results/measurements', {
          method: "POST",
          headers: {
              "X-API-TOKEN": inputData.token
          },
          data: {
              // The id of your key result
              id: inputData.id,
      
              // The new measurement value
              value: Number(inputData.value)
          }
      })
      
4

Test Your Zap

  1. Save and test your Zap.
  2. Ensure the data flows correctly and updates the intended OKR measurement in KnowKR.
5

Activate Your Zap

Once the test is successful, turn on your Zap to automate OKR measurement updates.

Additional Considerations

Rate Limits: Ensure your API usage stays within KnowKR’s rate limits (5 requests per minute). Security: Never expose your API key in publicly shared workflows.