# Anoncreds Credentials

An `AnoncredsCredential` is a member of the `Credential` union type, representing a credential which follows the Anoncreds specification. Anoncreds credentials can be managed using the same queries and mutations as for any credential.

Each Anoncreds credential is associated with a [credential definition](/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/credentials/anoncreds-credentials/credential-definitions.md), which in turn is associated with a [schema](/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/credentials/anoncreds-credentials/schemas.md).

## View Anoncreds credentials

View held Anoncreds credentials, with pagination and filtering options. Returns a `nextToken` which can be passed into the same query in order to fetch subsequent pages.

The `AnoncredsCredential` type provides the option to resolve its associated `AnoncredsCredDef` and `AnoncredsSchema` within a single operation.

```graphql
query MyQuery {
  credentials(
    page: {
      nextToken: null
    }
    filter: {
      credentialFormats: [ANONCREDS]
    }
  ) {
    items {
      __typename
      ... on AnoncredsCredential {
        id
        attributes {
          name
          value
        }
        credDefId
        credDef {
          schemaId
          schema {
            name
            version
          }
          tag
        }
      }
    }
    nextToken
  }
}
```

Alternatively, view a single Anoncreds credential, referenced by its unique ID.

```graphql
query MyQuery {
  credential(
    credentialId: "14eb376d-2b9c-4c30-b40f-ee3ec8250559"
  ) {
    __typename
    ... on AnoncredsCredential {
      id
      attributes {
        name
        value
      }
      credDefId
      credDef {
        schemaId
        schema {
          name
          version
        }
        tag
      }
    }
  }
}
```

## Delete an Anoncreds credential

Delete a held Anoncreds credential.

```graphql
mutation MyMutation {
  deleteCredential(
    credentialId: "14eb376d-2b9c-4c30-b40f-ee3ec8250559"
  )
}
```


---

# Agent Instructions: 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:

```
GET https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/credentials/anoncreds-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
