Setting Up and Configuring the Webhook

Setting Up and Configuring the Webhook

Ready to connect an external learning platform? Here is everything you need to create and configure your first Item Completions Incoming Webhook.


Overview

Each webhook you create gets its own credentials (URL and key) and its own configuration (field mapping and source type filter). You can create as many webhooks as you need - one per external system works well, since it keeps credentials and mappings isolated.

Before the external system can send completions, you need to:

  1. Create the webhook in Learn Amp and copy the credentials

  2. Configure the external system to POST to the webhook URL using the key

  3. Ensure the relevant items in your Learn Amp library have Completion controlled externally enabled


Pre-requisites

  • You are logged in as an Owner or Admin

  • The Item Completions Incoming Webhook integration has been enabled for your company (contact your Learn Amp representative if you are not sure)

  • The items you want to receive completions for must have Completion controlled externally turned on (Edit item > Details > Completion)


Quick Start Guide

Step 1 - Navigate to Item Completions

  1. Log in to Learn Amp as an Owner or Admin.

  2. From the sidebar, go to Integrations.

  3. Under Workflow and Automations, click Item Completions.

  4. Click the Configure tab.

Step 2 - Create a new webhook

  1. Click Add new webhook.

  2. Give the webhook a descriptive Name - this is shown in the table and helps you identify which external system the webhook belongs to (e.g. "KnowBe4 Security Training" or "LinkedIn Learning").

  3. Click Save.

Learn Amp generates a Webhook Key automatically. You will see it on the next screen.

Step 3 - Copy your credentials

After saving, Learn Amp displays:

  • Webhook URL: https://app.learnamp.com/webhooks/item_completions

  • Webhook Key: a UUID used to authenticate requests

⚠️ The Webhook Key is shown in full only once. Copy it now and store it securely - if you lose it, you will need to regenerate it.

Step 4 - Configure the external system

Provide the external system with the Webhook URL and tell it to include the Webhook Key on every request. The key can be sent in either of two ways:

  • As an Authorization header: Authorization: <your-webhook-key>

  • As a query parameter: https://app.learnamp.com/webhooks/item_completions?key=<your-webhook-key>

💡 No "Bearer" prefix is needed in the Authorization header - send the key value directly.

The external system must POST a JSON body. At minimum, every request needs an email address and one item identifier. See the Payload Fields section below for the full list.

Step 5 - Set up field mapping (if required)

If the external system sends data in a different format from Learn Amp's expected field names, configure field mapping on the webhook. See Field Mapping below.

Step 6 - Test the connection

Send a test POST request to the webhook URL with valid credentials, a known user email, and an item identifier. A 200 OK response confirms the completion was recorded. Check the user's profile in Learn Amp to verify it appears correctly.


Configuration

Webhook Name

The name is an admin-assigned label visible only in the Configure tab. It has no effect on how requests are processed. Use a name that makes it easy to identify the source system at a glance.

Source Type Filter

The source type filter restricts source_id lookups to items from a specific content provider. This is useful when multiple providers use the same external ID values.

For example, if both KnowBe4 and another provider assign numeric IDs starting from 1, without a source type filter a source_id of 1 could match the wrong item. Setting the source type filter to KnowBe4 ensures only KnowBe4 items are searched when matching by source_id.

When the filter is set, item_id and slug lookups are unaffected - only source_id matching is restricted.

Field Mapping

Field mapping translates the incoming payload from the external system's field names into the field names Learn Amp expects.

Configuration is a JSON object where each key is a Learn Amp field name and each value is the path to the corresponding field in the incoming payload.

Example

If the external system sends:

{ "user": { "email_address": "jane.smith@example.com" }, "course": { "external_id": "kb4-phishing-101" }, "completion": { "passed": "PASS", "percentage": 87, "duration_seconds": 300 } }

You would configure the field mapping as:

{ "email": "user.email_address", "source_id": "course.external_id", "result": "completion.passed", "score": "completion.percentage", "total_time": "completion.duration_seconds" }

Use dot notation to navigate nested objects.

💡 Leave a mapping path blank and Learn Amp will look for that field name directly in the top-level payload. Any fields not included in the mapping are discarded.

Payload Fields

This table lists every field Learn Amp understands in an incoming completion payload, after field mapping has been applied.

Field

Type

Required

Description

Field

Type

Required

Description

email

String

Yes

Email address of the user. Must match an active Learn Amp user.

item_id

String or Integer

One of three required

Learn Amp internal item ID.

source_id

String

One of three required

External source identifier set on the item.

slug

String

One of three required

URL slug of the item.

result

String

No

Pass/fail result (e.g. "PASS", "FAIL").

score

Integer

No

Numeric score (e.g. 95 for 95%).

total_time

Integer

No

Time spent in seconds (e.g. 120 for 2 minutes).

💡 Include at least one of item_id, source_id, or slug. If more than one is present, Learn Amp checks them in this order - item_id first, then source_id, then slug - and uses the first match it finds.

Regenerating the Webhook Key

If you suspect the key has been compromised, or if you want to rotate credentials as part of a security policy, click Regenerate key on the webhook's configure screen. The table on the Configure tab shows a Key Last Rotated timestamp for each webhook.

⚠️ After regeneration, the old key stops working immediately. Update the external system with the new key before regenerating - otherwise requests will fail until you do.


Response Codes

Every request gets a response code. Here is what each one means and what to do about it.

Code

Status

Meaning

Code

Status

Meaning

200

OK

Completion recorded successfully.

400

Bad Request

The request body is not valid JSON. Check the payload format.

401

Unauthorized

The Webhook Key is missing or does not match. Check the Authorization header or key query parameter.

404

Not Found

The user or item could not be found. See troubleshooting below.

422

Unprocessable Entity

The item was found but does not have Completion controlled externally enabled.

Example error response body:

{"error": "User not found"}

Troubleshooting

Symptom

Likely Cause

Resolution

Symptom

Likely Cause

Resolution

401 Unauthorized

Key is missing, incorrect, or has been regenerated

Check the Authorization header or key query parameter matches the current Webhook Key shown in Learn Amp

404 Not Found for a user

Email does not match an active user

Verify the email address is correct and the user account is active and not deactivated or suspended

404 Not Found for an item

None of the identifiers matched an item

Check item_id, source_id, or slug against the item in Learn Amp; verify the source type filter is not excluding the item

422 Unprocessable Entity

Item is not set to externally controlled

Edit the item: Edit item > Details > Completion > enable Completion controlled externally

400 Bad Request

Payload is not valid JSON

Confirm the external system is setting Content-Type: application/json and the body is well-formed JSON

Completion not appearing on user profile

Field mapping is incorrect

Review the field mapping; use a tool such as Postman to send a raw payload and confirm 200 OK before applying mapping

source_id matching the wrong item

Multiple providers share the same external IDs

Configure the Source Type Filter on the webhook to restrict lookups to the correct content provider

Key Last Rotated timestamp is unexpectedly recent

Key has been regenerated by another admin

Check with your team and update the external system with the current key