> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xkey.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Activities

> Every state-changing request to 0xkey becomes an activity: a signed, policy-checked, auditable record with a status you can poll.

An **activity** is the record 0xkey creates for every state-changing request: creating a wallet, signing a transaction, adding a user, updating a policy. Reads are **queries** and do not create activities.

| | Activities | Queries |
| :- | :- | :- |
| Path | `POST /public/v1/submit/*` | `POST /public/v1/query/*` |
| Stamped by a credential | Yes | Yes |
| Evaluated by the policy engine | Yes | No |
| Leaves an auditable record | Yes | No |

## Lifecycle

1. Your client builds the request body and [stamps](https://docs.0xkey.io/developer-reference/api-overview/stamps.md) it with an API key or passkey.
2. The enclave verifies the stamp and identifies the user behind the credential.
3. The [policy engine](https://docs.0xkey.io/policies/overview.md) evaluates the request. Root users can bypass policies once the [root quorum](https://docs.0xkey.io/concepts/users/root-quorum.md) threshold is met.
4. If allowed, the activity executes inside the enclave and the result is attached to the activity.

The response always carries an `activity` object. Branch on `activity.status`:

| Status | Meaning | What to do |
| :- | :- | :- |
| `ACTIVITY_STATUS_COMPLETED` | Executed; `activity.result` is populated | Read the result |
| `ACTIVITY_STATUS_PENDING` | Still processing asynchronously | Poll `get_activity` with `activity.id` |
| `ACTIVITY_STATUS_CONSENSUS_NEEDED` | A policy requires more approvals | Collect approvals with `approve_activity` |
| `ACTIVITY_STATUS_AUTHENTICATORS_NEEDED` | Additional authentication (MFA) is required | Complete the extra authentication step |
| `ACTIVITY_STATUS_REJECTED` | An approver rejected it | Treat as final |
| `ACTIVITY_STATUS_FAILED` | Execution failed; `activity.failure` explains why | Treat as final; fix the request |

Approvals expire 24 hours after the first one; the activity itself does not. See [Submissions](https://docs.0xkey.io/developer-reference/api-overview/submissions.md) for details.

> [!NOTE]
>
> The SDKs poll for you. The Swift and Kotlin SDKs throw when an activity does not reach `COMPLETED`. The TypeScript `apiClient()` returns the activity instead, so check `activity.status` before reading the result. Branch on status and error code, not on message text. See [Errors](https://docs.0xkey.io/developer-reference/api-overview/errors.md).

## Idempotency

The request body is hashed into a fingerprint. Re-submitting the same body returns the same activity instead of executing twice. To run the same operation again, change `timestampMs`.

## Related

* [Submissions](https://docs.0xkey.io/developer-reference/api-overview/submissions.md) and [Queries](https://docs.0xkey.io/developer-reference/api-overview/queries.md)
* [Policy overview](https://docs.0xkey.io/policies/overview.md)
* [Activity endpoints](https://docs.0xkey.io/api-reference/activities/overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.