# Definition

## Retrieve all credential definitions registered by a user

<mark style="color:green;">`GET`</mark> `/api/v1/definition`

\<Description of the endpoint>

**Headers**

| Name          | Value                    |
| ------------- | ------------------------ |
| Content-Type  | `application/json`       |
| Authorization | `apikey = {Alice's key}` |

**Body**

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "data": []
}
```

{% endtab %}

{% tab title="401" %}

```json
{
}
```

{% endtab %}
{% endtabs %}

## Retrieve a specific definitions by uid

<mark style="color:green;">`GET`</mark> `/api/v1/definition/{uid}`

\<Description of the endpoint>

**Headers**

| Name          | Value                    |
| ------------- | ------------------------ |
| Content-Type  | `application/json`       |
| Authorization | `apikey = {Alice's key}` |

**Body**

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "data": []
}
```

{% endtab %}

{% tab title="401" %}

```json
{
}
```

{% endtab %}
{% endtabs %}

## Create a new definition

<mark style="color:green;">`POST`</mark> `/api/v1/definition`

\<Description of the endpoint>

**Headers**

| Name          | Value                    |
| ------------- | ------------------------ |
| Content-Type  | `application/json`       |
| Authorization | `apikey = {Alice's key}` |

**Body**

| Name          | Type         | Description                                                    |
| ------------- | ------------ | -------------------------------------------------------------- |
| `name`        | string       | Name for this definition (compulsory)                          |
| `description` | string       | Description for this definition (compulsory)                   |
| `version`     | string       | Version for this definition (optional)                         |
| `author`      | string       | Published short DID of author for this definition (compulsory) |
| `tags`        | string       | optional                                                       |
| `location`    | string (url) | Location of the schema definition (httph://...)                |

**Response**

{% tabs %}
{% tab title="201" %}

```json
{
// todo....
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "data": null,
    "status": 400,
    "message": "Bad params for creating VC Definition"
}
```

{% endtab %}

{% tab title="401" %}

```json
{
}
```

{% endtab %}
{% endtabs %}
