---
title: "Create a credential interaction"
method: POST
path: "/v1/credential-interactions"
tags: ["Credential Interactions"]
---

# Create a credential interaction

`POST /v1/credential-interactions`

Creates a new credential interaction event.

  <Callout title="Important considerations" type="warn">
  This feature uses the browser's `LocalStorage` to identify the actions made by the recipient of the credential. When the user accesses the page with `?recipient=true` query parameter, the application saves that information in `LocalStorage` and removes the parameter from the URL. Actions taken afterwards in the same browser are recorded as the recipient's, until the `LocalStorage` data is cleared.

  If you are distributing the credential links independently and wish to track events as originating from the recipient, be sure to include the `?recipient=true` parameter. Without this parameter, we won't be able to mark this person as the recipient, and their actions will be marked under the `guest` actor category.

  This approach may not capture every scenario. For example, if a recipient opens a link with `?recipient=true` on one device, then shares the link without the parameter (or opens it on a different device without the stored flag), those subsequent views will be categorized as `guest`. Similarly, if the user clears their `LocalStorage` or uses an incognito session, the system can no longer confirm that they are the recipient.

  </Callout>

## Headers

- `Certifier-Version` string, required — API version header. Required for all requests.

## Request body

- CreateCredentialInteraction
  - `credentialId` string, required — The unique credential's identifier, to which this credential interaction belongs
  - `eventType` 'credential_viewed' | 'credential_shared_to_linkedin' | 'credential_added_to_linkedin_profile' | 'credential_shared_to_facebook' | 'credential_shared_to_twitter' | 'credential_shared_to_messenger' | 'credential_shared_to_whatsapp' | 'credential_shared_to_pinterest' | 'credential_shared_to_telegram' | 'credential_shared_to_weibo' | 'credential_downloaded' | 'credential_link_copied' | 'credential_verified', required — Specifies the type of user interaction event related to the credential
  - `triggeredBy` 'recipient' | 'guest', required — The actor that triggered this credential interaction. Currently one of two values: recipient or guest
  - `triggeredAt` string, date-time, required — The date and time when this credential interaction happened. Formatted as an ISO 8601 date and time string

## Response `200`

Credential interaction created successfully

- CredentialInteraction
  - `id` string, required — The unique credential interaction's identifier
  - `credentialId` string, required — The unique credential's identifier, to which this credential interaction belongs
  - `eventType` 'credential_viewed' | 'credential_shared_to_linkedin' | 'credential_added_to_linkedin_profile' | 'credential_shared_to_facebook' | 'credential_shared_to_twitter' | 'credential_shared_to_messenger' | 'credential_shared_to_whatsapp' | 'credential_shared_to_pinterest' | 'credential_shared_to_telegram' | 'credential_shared_to_weibo' | 'credential_downloaded' | 'credential_link_copied' | 'credential_verified', required — Specifies the type of user interaction event related to the credential
  - `triggeredBy` 'recipient' | 'guest', required — The actor that triggered this credential interaction. Currently one of two values: recipient or guest
  - `triggeredAt` string, date-time, required — The date and time when this credential interaction happened. Formatted as an ISO 8601 date and time string

## Other responses

- `400` — Bad Request - Missing version, invalid version, invalid JSON, or validation error
- `401` — Unauthorized - Invalid or missing authentication token
- `429` — Rate Limited - Too many requests
- `500` — Internal Server Error - Problem on Certifier's end

---

[API](https://skmtc.dev/certifier/apis/certifier-api.md) · [All operations](https://skmtc.dev/certifier/apis/certifier-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/certifier/certifier-api/revisions/a84fb47b7f6f/schema)
