Skip to main content

List credential schemas

Returns a list of credential schemas. Use the optional parameters to filter and sort.

See the credential schemas guide for more information.

Function

getCredentialSchemas(query: CredentialSchemaListQuery): Promise<ItemList<CredentialSchema>>

Parameters

export interface CredentialSchemaListQuery extends ListQuery {
sort?: SortableCredentialSchemaColumnEnum;
sortDirection?: SortDirection;
name?: string;
ids?: string[];
exact?: ExactCredentialSchemaFilterColumnEnum[];
include?: CredentialSchemaListIncludeEntityType[];
}
export interface ListQuery {
page: number;
pageSize: number;
organisationId: string;
}
  • page - Returns a specific page of the results. The first page is 0.

  • pageSize - Specify how many items appear on each page.

  • organisationId - Value from create organization.

  • sorting - If no sorting values are provided, CREATED_DATE + DESCENDING are used. If a value is passed for sort, the default direction becomes ASCENDING.

    • sort - Sort by certain values in the response body.

      • [CREATED_DATE, SCHEMA_NAME, ISSUER_DID, STATE]
    • sortDirection - Default value = DESCENDING.

      • [ASCENDING, DESCENDING]
  • name - Return credentials whose credential schema's name starts with this string. Not case-sensitive.

  • ids - Specify credential schemas to be returned.
  • exact - Set which filters apply in an exact way.

    • [NAME]
  • include - Include certain values in the return. Supported values:

    • LAYOUT_PROPERTIES: return the design elements of credentials, so credentials can be displayed as intended

Return value

export interface ItemList<Item> {
totalItems: number;
totalPages: number;
values: Item[];
}
export interface CredentialSchema {
id: string;
createdDate: string;
lastModified: string;
name: string;
format: string;
revocationMethod: string;
walletStorageType?: WalletStorageType;
schemaId: string;
schemaType: CredentialSchemaType;
layoutType?: LayoutType;
}

Fields

  • format - Credential format of the credentials issued using this schema.

  • revocationMethod - Revocation method of credentials issued using this schema, if any.

  • walletStorageType - Wallet storage type requested by the verifier, if any.

  • layoutType - Represents the visual structure of the credential in the wallet. The details of the design of the credential (for credentials issued by Procivis One) are found in the CredentialSchemaDetail of the get credential details function. For more information on the display properties of Procivis One credentials, see the credentials designer guide.