> For the complete documentation index, see [llms.txt](https://docs.learncard.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.learncard.com/understand/verifiable-credentials-vcs/xapi-data.md).

# xAPI Data

How learning-activity records (xAPI) relate to credentials in LearnCard, and how to name your activities.

A credential says *what someone achieved*. An xAPI statement says *what they did*. LearnCard stores both, and the second is often the evidence for the first.

## What xAPI is

[xAPI](https://xapi.com/) (Experience API) records learning activity as simple statements — **actor, verb, object**:

> Jane — completed — "Module 2: Machine Learning Basics"

It isn't tied to courses or an LMS. A statement can describe reading an article, finishing a level in a game, attending a workshop, or passing a quiz. Each statement is a small JSON object with a standard shape, so tools from different vendors can read each other's records.

## How LearnCard uses it

* **Storage.** The LearnCloud Storage API accepts xAPI statements at `/xapi/statements`. Statements are stored under the learner's DID and are the learner's data — you write them with the learner's permission, not to a store you own. See [Send xAPI Statements](/build/sending-xapi-statements.md).
* **Evidence.** When you issue a credential, you can point its `evidence` at the statements that justify it. "Completed AI Fundamentals" becomes more useful when a verifier can see the four module completions and quiz passes behind it.
* **Triggers.** Your system decides when a pattern of statements earns a credential — four modules complete → issue the course badge. LearnCard doesn't do this automatically; it gives you the store and the `send()`.

## Naming your activities

Every statement's `object.id` is a URI you choose. Verbs are usually taken from the [ADL registry](http://adlnet.gov/expapi/verbs/) as-is:

```javascript
verb: { id: 'http://adlnet.gov/expapi/verbs/completed', display: { 'en-US': 'completed' } },
object: {
    id: 'https://docs.yourgame.com/xapi/activities/level-1/custom-challenge',
    definition: {
        name: { 'en-US': 'Level 1 Custom Challenge' },
        type: 'http://adlnet.gov/expapi/activities/simulation',
    },
},
```

Three rules that save pain later:

1. **Use a domain you control**, with a consistent path structure. A made-up domain is valid xAPI, but a real one lets you publish what the activity means.
2. **Make the URI resolve to a description** if you can — what the activity is, what it demonstrates, which skills it maps to. Verifiers and analysts will look.
3. **Never reuse an ID for a different activity.** New version, new ID. An ID is a permanent name, not a label.

## Related

* [Building Verifiable Credentials](/understand/verifiable-credentials-vcs/building-verifiable-credentials.md) — the `evidence` field
* [xAPI reference](/reference/learncloud-storage-api/xapi-reference.md) — endpoints, authentication, and the `X-VP` header


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.learncard.com/understand/verifiable-credentials-vcs/xapi-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
