> For the complete documentation index, see [llms.txt](https://docs.empe.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.empe.io/develop/wallet-server/api-reference/credential-management.md).

# Credential Management

## GET /credentials

> Retrieve all stored credentials for a DID

```json
{"openapi":"3.0.0","info":{"title":"Wallet API","version":"1.0"},"security":[{"oneclick-jwt":[]}],"components":{"securitySchemes":{"oneclick-jwt":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"One-Click access token (Authorization: Bearer <JWT>)"}},"schemas":{"GetCredentialsResponseDto":{"type":"object","properties":{"credentials":{"description":"Array of verifiable credentials","type":"array","items":{"type":"string"}}},"required":["credentials"]}}},"paths":{"/credentials":{"get":{"operationId":"CredentialController_getCredentialCollection","parameters":[{"name":"network","required":false,"in":"query","description":"The network to use for DID creation","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","description":"The type of credential to retrieve","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"The credential status to filter by","schema":{"type":"string","enum":["refresh","revocation","suspension","message"]}},{"name":"issuedAt","required":false,"in":"query","description":"The credential issuance date to filter by","schema":{"type":"string"}},{"name":"version","required":false,"in":"query","description":"The credential version to filter by","schema":{"type":"number","enum":[1,2]}}],"responses":{"200":{"description":"The credentials have been successfully retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCredentialsResponseDto"}}}}},"summary":"Retrieve all stored credentials for a DID","tags":["Credential Management"]}}}}
```

## POST /credentials

> Import a credential from a JSON object

```json
{"openapi":"3.0.0","info":{"title":"Wallet API","version":"1.0"},"security":[{"oneclick-jwt":[]}],"components":{"securitySchemes":{"oneclick-jwt":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"One-Click access token (Authorization: Bearer <JWT>)"}},"schemas":{"ImportCredentialDto":{"type":"object","properties":{"credential":{"description":"Credential to import","oneOf":[{"$ref":"#/components/schemas/VerifiableCredentialDto"}],"allOf":[{"$ref":"#/components/schemas/VerifiableCredentialDto"}]},"allowForeignSubject":{"type":"boolean","description":"If allowForeignSubject is true allow any credential. If false (default) check if credential has subject Id, if it has it must match one of active DIDs of the wallet","default":false}},"required":["credential","allowForeignSubject"]},"VerifiableCredentialDto":{"type":"object","properties":{"@context":{"description":"JSON-LD @context","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"type":{"description":"Credential types","type":"array","items":{"type":"string"}},"id":{"type":"string","description":"Credential ID (URI)"},"issuer":{"description":"Issuer (DID or object with id)","oneOf":[{"$ref":"#/components/schemas/IssuerObjectDto"},{"$ref":"#/components/schemas/IssuerStringDto"}]},"issuanceDate":{"type":"string","description":"Issuance date"},"credentialSubject":{"description":"Credential subject(s)","oneOf":[{"$ref":"#/components/schemas/CredentialSubjectDto"},{"type":"array","items":{"$ref":"#/components/schemas/CredentialSubjectDto"}}]},"proof":{"description":"Proof","oneOf":[{"$ref":"#/components/schemas/ProofDto"}]},"expirationDate":{"type":"string","description":"Expiration date"},"credentialSchema":{"description":"Credential schema","oneOf":[{"$ref":"#/components/schemas/CredentialSchemaDto"}],"allOf":[{"$ref":"#/components/schemas/CredentialSchemaDto"}]},"credentialStatus":{"type":"array","description":"Credential status entries","items":{"$ref":"#/components/schemas/CredentialStatusEntryDto"}},"evidence":{"description":"Additional evidence","oneOf":[{"$ref":"#/components/schemas/FreeFormObjectDto"}]},"_ext":{"type":"object","additionalProperties":true}},"required":["@context","type","id","issuer","issuanceDate","credentialSubject"]},"IssuerObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"Issuer DID"}},"required":["id"]},"IssuerStringDto":{"type":"object","properties":{"value":{"type":"string","description":"Issuer DID"}},"required":["value"]},"CredentialSubjectDto":{"type":"object","properties":{"id":{"type":"string","description":"Subject DID"},"_":{"type":"object","description":"Additional subject claims","additionalProperties":true}},"required":["_"]},"ProofDto":{"type":"object","properties":{"_":{"type":"object","additionalProperties":true}},"required":["_"]},"CredentialSchemaDto":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]},"CredentialStatusEntryDto":{"type":"object","properties":{"_":{"type":"object","additionalProperties":true}},"required":["_"]},"FreeFormObjectDto":{"type":"object","properties":{"_":{"type":"object","additionalProperties":true}},"required":["_"]},"ImportCredentialResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Credential identifier"}},"required":["id"]}}},"paths":{"/credentials":{"post":{"operationId":"CredentialController_importCredential","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportCredentialDto"}}}},"responses":{"201":{"description":"Credential imported successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportCredentialResponseDto"}}}},"400":{"description":"Invalid credential (missing recipient/schema or subject mismatch)"},"409":{"description":"Credential with this id already exists"},"422":{"description":"Proof verification failed"}},"summary":"Import a credential from a JSON object","tags":["Credential Management"]}}}}
```

## DELETE /credentials

> Delete all credentials

```json
{"openapi":"3.0.0","info":{"title":"Wallet API","version":"1.0"},"security":[{"oneclick-jwt":[]}],"components":{"securitySchemes":{"oneclick-jwt":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"One-Click access token (Authorization: Bearer <JWT>)"}}},"paths":{"/credentials":{"delete":{"operationId":"CredentialController_deleteAllCredentials","parameters":[],"responses":{"204":{"description":"All credentials have been successfully deleted."},"401":{"description":"Missing or invalid authentication token.","content":{"application/json":{}}}},"summary":"Delete all credentials","tags":["Credential Management"]}}}}
```

## GET /credentials/{id}

> Retrieve a credential by its ID

```json
{"openapi":"3.0.0","info":{"title":"Wallet API","version":"1.0"},"security":[{"oneclick-jwt":[]}],"components":{"securitySchemes":{"oneclick-jwt":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"One-Click access token (Authorization: Bearer <JWT>)"}},"schemas":{"GetCredentialResponseDto":{"type":"object","properties":{"credential":{"type":"object","description":"Verifiable credential"}},"required":["credential"]}}},"paths":{"/credentials/{id}":{"get":{"operationId":"CredentialController_getCredential","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"The credential has been successfully retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCredentialResponseDto"}}}}},"summary":"Retrieve a credential by its ID","tags":["Credential Management"]}}}}
```

## DELETE /credentials/{id}

> Delete a specific credential

```json
{"openapi":"3.0.0","info":{"title":"Wallet API","version":"1.0"},"security":[{"oneclick-jwt":[]}],"components":{"securitySchemes":{"oneclick-jwt":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"One-Click access token (Authorization: Bearer <JWT>)"}}},"paths":{"/credentials/{id}":{"delete":{"operationId":"CredentialController_deleteCredential","parameters":[{"name":"id","required":true,"in":"path","description":"Credential identifier to delete","schema":{"type":"string"}}],"responses":{"204":{"description":"The credential has been successfully deleted."},"401":{"description":"Missing or invalid authentication token.","content":{"application/json":{}}},"404":{"description":"Credential not found.","content":{"application/json":{}}}},"summary":"Delete a specific credential","tags":["Credential Management"]}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.empe.io/develop/wallet-server/api-reference/credential-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
