# Create AnonCreds Credential Definition

## Create Credential Definition

The request body must contain the `credential_definition` object with the Issuer DID and the Schema ID created in the previous steps.

To enable revocation, the `options` must contain the revocation flag, and the size of the revocation registry. Also, ensure that a [Tails Server](https://github.com/bcgov/indy-tails-server) is configured for the issuer.

{% openapi src="<https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74>" path="/anoncreds/credential-definition" method="post" %}
[swagger.json](https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media\&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74)
{% endopenapi %}

## Request Body

<details>

<summary>credential_definition (mandatory)</summary>

"issuerId": DID of the Issuer.

"schemaId": The AnonCreds Schema ID created by the Issuer (must be of the same DID).

"tag": Additional Name to identify the Credential Definition.

</details>

<details>

<summary>options (optional)</summary>

"support\_revocation": Boolean value to indicate that the Credential can be revoked or not. (Tails server must be configured if this is set to \`true\`)

"revocation\_registry\_size": Maximum size of the Revocation Registry.

</details>

## Check the new Credential Definition

{% openapi src="<https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74>" path="/anoncreds/credential-definition/{cred\_def\_id}" method="get" %}
[swagger.json](https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media\&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74)
{% endopenapi %}
