> For the complete documentation index, see [llms.txt](https://docs.indicio.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.indicio.tech/developer/indicio-proven-r/api-reference/credentials.md).

# Credentials

Endpoints for issuing and retrieving credentials

## Issue JSON-LD credentials

> This endpoint issues JSON-LD credentials.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials/json-ld":{"post":{"summary":"Issue JSON-LD credentials","description":"This endpoint issues JSON-LD credentials.","tags":["Credentials"],"parameters":[{"in":"query","name":"timeout","required":false,"schema":{"type":"integer"},"description":"The timeout for the credential issuance (seconds)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitation_id":{"type":"number","nullable":true,"description":"The invitation ID."},"contact_id":{"type":"string","nullable":true,"description":"The contact ID."},"revocation_def_id":{"type":"string","nullable":true,"description":"The ID of status list definition to enable revocation"},"credential":{"type":"object","description":"The credential object.","properties":{"@context":{"type":"array","items":{"type":"string"},"description":"The contexts of the credential."},"issuanceDate":{"type":"string","format":"date-time","description":"The issuance date of the credential."},"validFrom":{"type":"string","format":"date-time","description":"The valid from date of the credential."},"awardedDate":{"type":"string","format":"date-time","description":"The awarded date of the credential."},"expirationDate":{"type":"string","format":"date-time","description":"The expiration date of the credential."},"validUntil":{"type":"string","format":"date-time","description":"The valid until date of the credential."},"type":{"type":"array","items":{"type":"string"},"description":"The types of the credential."},"description":{"type":"string","description":"The description of the credential."},"name":{"type":"string","description":"The name of the credential."},"issuer":{"type":"object","description":"The issuer of the credential.","properties":{"id":{"type":"string","description":"The identifier of the issuer"},"type":{"type":"array","items":{"type":"string"},"description":"The types of the issuer."},"name":{"type":"string","description":"The name of the issuer."},"description":{"type":"string","description":"The description of the issuer."},"url":{"type":"string","description":"The URL of the issuer."},"email":{"type":"string","description":"The email of the issuer."},"image":{"type":"object","description":"The image of the issuer.","properties":{"id":{"type":"string","description":"The ID of the image."},"type":{"type":"string","description":"The type of the image."},"caption":{"type":"string","description":"The caption of the image."}}}}},"credentialSubject":{"type":"object","description":"The credential subject.","properties":{"type":{"type":"array","items":{"type":"string"},"description":"The types of the credential subject."},"achievement":{"type":"object","description":"The achievement of the credential subject.","properties":{"id":{"type":"string","description":"The ID of the achievement."},"name":{"type":"string","description":"The name of the achievement."},"description":{"type":"string","description":"The description of the achievement."},"criteria":{"type":"object","description":"The criteria of the achievement.","properties":{"type":{"type":"string","description":"The type of the criteria."},"narrative":{"type":"string","description":"The narrative of the criteria."}}},"image":{"type":"object","description":"The image of the achievement.","properties":{"id":{"type":"string","description":"The ID of the image."},"type":{"type":"string","description":"The type of the image."}}},"type":{"type":"array","items":{"type":"string"},"description":"The types of the achievement."}}}}}}},"proofType":{"type":"string","description":"The proofType for the credential issuance"},"rule":{"type":"string","description":"The rule for the credential issuance."}}}}}},"responses":{"200":{"description":"JSON-LD credential issued successfully","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized."},"422":{"description":"Unprocessable Entity.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Retrieve a JSON-LD credential by ID

> This endpoint retrieves a JSON-LD credential by its ID using the provided API key.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials/json-ld/{request_id}":{"get":{"summary":"Retrieve a JSON-LD credential by ID","description":"This endpoint retrieves a JSON-LD credential by its ID using the provided API key.","tags":["Credentials"],"parameters":[{"in":"path","name":"request_id","required":true,"schema":{"type":"string"},"description":"The ID of the credential."}],"responses":{"200":{"description":"JSON-LD credential retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","description":"The retrieved JSON-LD credential record."}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized."},"404":{"description":"JSON-LD credential record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Retrieve all credentials

> This endpoint retrieves all credentials associated with the provided API.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials":{"get":{"summary":"Retrieve all credentials","description":"This endpoint retrieves all credentials associated with the provided API.","tags":["Credentials"],"parameters":[{"in":"query","name":"sort-field","schema":{"type":"string"},"description":"The field to sort by (default updated_at)."},{"in":"query","name":"sort-direction","schema":{"type":"string"},"description":"The direction to sort (ASC or DESC, default DESC)."},{"in":"query","name":"page-size","schema":{"type":"integer"},"description":"The number of credentials per page (default 20)."},{"in":"query","name":"current-page","schema":{"type":"integer"},"description":"The current page number (default 1)."},{"in":"query","name":"item-count","schema":{"type":"integer"},"description":"The total number of items."},{"in":"query","name":"state-filter","schema":{"type":"string"},"description":"If provided, returns only credentials with this state."},{"in":"query","name":"contact-id","schema":{"type":"string"},"description":"If provided, returns only credentials for this contact_id."}],"responses":{"200":{"description":"A paginated list of credentials","content":{"application/json":{"schema":{"type":"object","properties":{"params":{"type":"object","properties":{"sort":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"pageSize":{"type":"integer"},"currentPage":{"type":"integer"},"pageCount":{"type":"integer"},"itemCount":{"type":"integer"},"stateFilter":{"type":"string","nullable":true},"contactIdFilter":{"type":"string","nullable":true}}},"rows":{"type":"array","items":{"type":"object"}},"count":{"type":"integer"}}}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Issue a new AnonCred credential

> This endpoint allows you to add a new credential request.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials":{"post":{"summary":"Issue a new AnonCred credential","description":"This endpoint allows you to add a new credential request.","tags":["Credentials"],"parameters":[{"in":"query","name":"timeout","required":false,"schema":{"type":"integer"},"description":"The timeout for the credential issuance (seconds)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitation_id":{"type":"integer","description":"The ID of the invitation."},"contact_id":{"type":"string","description":"The ID of the contact."},"schema_id":{"type":"string","description":"The ID of the schema."},"attributes":{"type":"array","description":"A list of objects representing the attributes for the credential.","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the attribute."},"value":{"type":"string","description":"The value of the attribute."}}}},"rule":{"type":"string","description":"The rule for the credential issuance."}}}}}},"responses":{"200":{"description":"AnonCred credential issuance record was created","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized."},"422":{"description":"Unprocessable Entity.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Retrieve a credential by its credential definition ID

> This endpoint retrieves a specific credential by its credential exchange ID.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials/{credential_exchange_id}":{"get":{"summary":"Retrieve a credential by its credential definition ID","description":"This endpoint retrieves a specific credential by its credential exchange ID.","tags":["Credentials"],"parameters":[{"in":"path","name":"credential_exchange_id","required":true,"schema":{"type":"string"},"description":"The credential exchange ID."}],"responses":{"200":{"description":"A credential object","content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"object"}}}}}},"401":{"description":"Unauthorized."},"404":{"description":"Credential record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Remove PII from a credential

> This endpoint manually removes PII from a credential record.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials/{credential_exchange_id}/pii":{"post":{"summary":"Remove PII from a credential","description":"This endpoint manually removes PII from a credential record.","tags":["Credentials"],"parameters":[{"in":"path","name":"credential_exchange_id","required":true,"schema":{"type":"string"},"description":"The credential exchange ID."}],"responses":{"200":{"description":"PII removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized."},"404":{"description":"Credential record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Retrieve an AnonCred credential record by ID

> This endpoint retrieves an AnonCred credential record by its ID using the provided API key.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credential-records/{request_id}":{"get":{"summary":"Retrieve an AnonCred credential record by ID","description":"This endpoint retrieves an AnonCred credential record by its ID using the provided API key.","tags":["Credentials"],"parameters":[{"in":"path","name":"request_id","required":true,"schema":{"type":"string"},"description":"The ID of the credential record."}],"responses":{"200":{"description":"Credential record retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","description":"The retrieved AnonCred credential record."}}}}}},"401":{"description":"Unauthorized."},"404":{"description":"AnonCred credential record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Revoke an issued AnonCred credential

> This endpoint allows you to revoke a credential by providing the connection and credential exchange IDs.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Credentials","description":"Endpoints for issuing and retrieving credentials"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/credentials/anoncreds/revoke":{"post":{"summary":"Revoke an issued AnonCred credential","description":"This endpoint allows you to revoke a credential by providing the connection and credential exchange IDs.","tags":["Credentials"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connection_id":{"type":"string","description":"The connection ID associated with the credential."},"credential_exchange_id":{"type":"string","description":"The credential exchange ID of the credential to revoke."}}}}}},"responses":{"200":{"description":"Credential revocation request accepted or already revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized"},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```
