# Metadata (DCP)

{% hint style="info" %}
Specifications and best practice implementations for Verifiable Credentials are currently being developed. This page is expected to be updated, closely following these developments.
{% endhint %}

The `GET` request to the `/metadata` endpoint requests an overview of supported credential types by the issuer. The credential types that are defined by the iSHARE Framework are defined on the [iSHARE Schemas Site](https://schemas.ishare.eu/v3/). An iSHARE Participant Registry must, at a minimum, issue a [Participant Credential](https://schemas.ishare.eu/v3/party/schema.json). An iSHARE Authorisation Registry must, at a minimum, issue a [Data Rights Credential](https://schemas.ishare.eu/v3/party/schema.json).

{% hint style="info" %}
The `GET` request to the `/metadata` is an **OPTIONAL** endpoint and is part of the iSHARE Framework's Verifiable Credentials support in line with the **Decentralised Claims Protocol (DCP)**.
{% endhint %}

## Gets credential types supported by the issuer

> Retrieves a list of supported credential types that the issuer can provide. More information in the \[DCP specification]\(<https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#issuermetadata).\\>
> The credential types that are defined by the iSHARE Framework are defined on the \[iSHARE Schemas Site]\(<https://schemas.ishare.eu/v3/).\\>
> An iSHARE Participant Registry must at minimum issue a \[Participant Credential]\(<https://schemas.ishare.eu/v3/party/schema.json>). An iSHARE Authorization Registry must at minimum issue a \[Data Rights Credential]\(<https://schemas.ishare.eu/v3/data-rights/schema.json>).

```json
{"openapi":"3.1.0","info":{"title":"iSHARE Decentralized Claims Protocol (DCP) API specifications","version":"3.0"},"tags":[{"name":"Issuer","description":"Endpoints relevant for the VC Issuer role (e.g., issuing credentials, issuer metadata)."}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"iSHARE JWT Bearer token authentication"}}},"paths":{"/metadata":{"get":{"tags":["Issuer"],"summary":"Gets credential types supported by the issuer","description":"Retrieves a list of supported credential types that the issuer can provide. More information in the [DCP specification](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#issuermetadata).\nThe credential types that are defined by the iSHARE Framework are defined on the [iSHARE Schemas Site](https://schemas.ishare.eu/v3/).\nAn iSHARE Participant Registry must at minimum issue a [Participant Credential](https://schemas.ishare.eu/v3/party/schema.json). An iSHARE Authorization Registry must at minimum issue a [Data Rights Credential](https://schemas.ishare.eu/v3/data-rights/schema.json).","operationId":"get-metadata","responses":{"200":{"description":"Metadata retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/x-ext/59ce031"}}}},"401":{"description":"Unauthorized - Invalid or missing authentication"},"404":{"description":"Metadata not found"},"500":{"description":"Internal Server Error"}}}}}}
```

### Request model

There are no request parameters defined.

### Example request

```json
GET /metadata
Authorization: Bearer YOUR_SECRET_TOKEN
```

### Response model

The model for the IssuerMetadata is defined in: <https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/issuance/issuer-metadata-schema.json>.

* `@context`\
  **Array of Strings**. Root level. <mark style="color:red;">(Required)</mark>\
  Specifies a valid Json-Ld context. Must contain `"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"`
* `type`\
  **String**. Root level. <mark style="color:red;">(Required)</mark>\
  A string specifying the CredentialStatus type. Must contain `"IssuerMetadata"`
* `issuer`

  **String**. Root level. <mark style="color:red;">(Required)</mark>\
  The credential issuer DID.
* `credentialsSupported`\
  **Array of Objects**. Root level.\
  An array of [credential objects](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#credentialobject) that the issuer supports.
  * `id`\
    **String**. Contained in credential object. <mark style="color:red;">(Required)</mark>\
    A string defining a unique, stable identifier for this CredentialObject.
  * `type`\
    **String**. Contained in credential object. <mark style="color:red;">(Required)</mark>\
    A string specifying the object type. Must contain `CredentialObject`.
  * `credentialType`\
    **String**. Contained in credential object.\
    A single string specifying type of credential being offered.
  * `credentialSchema`\
    **String**. Contained in credential object.\
    A URL pointing to the credential schema of the object in a VC's `credentialSubject` property.
  * `bindingMethods`\
    **Array of strings**. Contained in credential object.\
    An array of strings defining the key material that an issued credential is bound to.
  * `profile`\
    **String**. Contained in credential object.\
    Contains the alias of the [profiles](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#profiles-of-the-decentralized-claims-protocol), e.g. `"vc20-bssl/jwt"`.
  * `issuancePolicy`\
    **Object**. Contained in credential object.\
    A [presentation definition](https://identity.foundation/presentation-exchange/spec/v2.1.1/#presentation-definition) signifying the required [Verifiable Presentation](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#dfn-verifiable-presentation) for issuance. Further details are omitted from this specifications, refer to <https://identity.foundation/presentation-exchange/spec/v2.1.1/#presentation-definition> for more information.

### Example response

```json
{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "IssuerMetadata",
  "issuer": "did:ishare:EU.NL.NTRLNL-10000000",
  "credentialsSupported": [
    {
      "id": "d5c77b0e-7f4e-4fd5-8c5f-28b5fc3f96d1",
      "type": "CredentialObject",
      "credentialType": "FrameworkRole",
      "credentialSchema": "https://schemas.ishare.eu/v3/party/claims/framework-role/schema.json",
      "bindingMethods": [
        "did:web"
      ],
      "profile": "vc10-sl2021/jwt",
      "issuancePolicy": {
        "id": "a468fc48-5c1a-43c7-903e-ab1851882afb",
        "input_descriptors": [
          {
            "id": "framework-compliance",
            "name": "Requires proof of compliance to framework",
            "purpose" :: 
            "constraints": {
              "fields": [
                {
                  "path": [
                    "$.vc.type"
                  ],
                  "filter": {
                    "type": "string",
                    "pattern": "^FrameworkCompliance$"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```
