---
title: "Import a Credential"
description: "Import a signed Verifiable Credential (JWT or SD-JWT) directly into a walt.id wallet via the API."
stack: "Community Stack (open source) — version 0.21.0"
stack_version: "0.21.0"
stack_comparison: https://docs.walt.id/community-vs-enterprise.md
canonical_url: https://docs.walt.id/community-stack/wallet/credential-management/import-credential
generated: 2026-07-20
---
# Import a Credential

Import a signed Verifiable Credential in JWT or SD-JWT format directly into a wallet. This is useful when a credential has been issued outside of the standard OID4VCI flow and needs to be stored manually.

The import endpoint validates the credential's format, verifies its signature, checks the DID binding, and prevents duplicate imports.

## Import a Credential

**Option: CURL**

**Endpoint:** `POST /wallet-api/wallet/{walletId}/credentials/import` | [API Reference](https://wallet.demo.walt.id/swagger/index.html#/WalletCredentials/post_wallet_api_wallet__wallet__credentials_import)

##### Example Request

```bash
curl -X 'POST' \
  'http://0.0.0.0:7001/wallet-api/wallet/{walletId}/credentials/import' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {token}' \
  -d '{
    "jwt": "<signed-jwt-or-sd-jwt>",
    "associated_did": "<did-in-your-wallet>"
  }'
```

**Path Parameters**

- `walletId`: _String_ - The ID of the wallet to import the credential into. See [Accounts & Wallets](https://docs.walt.id/community-stack/wallet/accounts-wallets.md#retrieve-wallet-id) for how to retrieve it.

**Header Parameters**

- `Authorization`: _String_ - Bearer token obtained from the [login endpoint](https://docs.walt.id/community-stack/wallet/authentication/email-password-auth.md#login). Format: `Bearer {token}`.

**Body Parameters**

- `jwt`: _String_ - The signed Verifiable Credential in JWT or SD-JWT format.
- `associated_did`: _String_ - A DID owned by the wallet to associate the credential with. The credential's `sub` claim must match this DID.

---

##### Example Response

On success, the API returns `201 Created` with no response body.

| Status | Description |
|--------|-------------|
| `201`  | Credential imported successfully |
| `400`  | Invalid JWT format, VC structure, or validation failed |
| `401`  | Invalid or missing authentication |
| `409`  | Credential already exists in the wallet |

## Validation

The following checks are performed on every import:

- **Format** — The value must be a valid JWT or SD-JWT (three Base64URL-encoded parts separated by dots, or an SD-JWT with `~`-separated disclosures).
- **VC structure** — The JWT payload must contain valid W3C Verifiable Credential claims.
- **Signature** — The issuer's cryptographic signature is verified.
- **DID binding** — The `sub` claim must match the `associated_did` provided.
- **Time window** — The `iat` must not be in the future; `exp` (if present) must not be in the past.
- **Duplicate check** — If a credential with the same `id` already exists, the import is rejected with `409 Conflict`.

## SD-JWT Support

The endpoint accepts both regular JWTs and SD-JWTs. SD-JWTs follow the format:

```
<issuer-signed-jwt>~<disclosure1>~<disclosure2>~...~<optional-key-binding-jwt>
```

The full credential including all disclosures is stored in the wallet, and all validation checks apply equally.

**Note:**

For receiving credentials from issuers through the standard protocol, see [Credential Exchange](https://docs.walt.id/community-stack/wallet/credential-exchange/overview.md).
