---
title: Read Metadata
slug: api-marketplace/read-metadata
createdAt: 2024-02-08T08:32:54.934Z
---

### Introduction

This API is responsible for reading metadata for a given Consumer ID and API Name. By omitting API Name, users can fetch the global metadata for the corresponding consumer.

In case, both global and API specific metadata exists, reading metadata would always prioritize APIs.

### cURL

:::CodeblockTabs
Production

```curl
curl --location 'https://api.signzy.app/api/v3/metahub/read-metadata' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Access-Token>'  \
--data '{
    "consumerId": "consumer123",
    "apiName": "/gstr-analytics/create-request"
}'
```

Pre-Production

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/metahub/read-metadata' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Access-Token>'  \
--data '{
    "consumerId": "consumer123",
    "apiName": "/gstr-analytics/create-request"
}'
```
:::

### Request Headers

| Key           | Value            |
| ------------- | ---------------- |
| Authorization | shared by Signzy |
| Content-type  | application/json |

### Request Body

```json
{
    "consumerId": "consumer123",
    "apiName": "/gstr-analytics/create-request"
}
```

| PARAMETERS | DESCRIPTION                                                  | TYPE   | VALUE (COMPULSORY OR OPTIONAL) |
| ---------- | ------------------------------------------------------------ | ------ | ------------------------------ |
| consumerId | A unique id shared by Signzy during onboarding of the client | String | COMPULSORY                     |
| apiName    | Name of the API                                              | String | OPTIONAL                       |

### Response Data

:::CodeblockTabs
200 OK

```json
{
    "result": {
        "callbacks": [
            {
                "url": "https://client-api-specific-callback.url",
                "authType": "key-auth",
                "headers": [
                    {
                        "key": "Authorization",
                        "value": "QWERTYUIOP"
                    }
                ]
            }
        ]
    }
}
```
:::

| PARAMETERS  | DESCRIPTION                                                | TYPE           | VALUE (COMPULSORY OR OPTIONAL) |
| ----------- | ---------------------------------------------------------- | -------------- | ------------------------------ |
| result      | This parameter contains the actual output.                 | Object         | OPTIONAL                       |
| logoUrls    | Url of the consumer logo                                   | List of String | OPTIONAL                       |
| domainNames | List of Domain names that have to be whitelisted in Signzy | List of String | OPTIONAL                       |
| callbacks   | List of callback configs                                   | List of Object | OPTIONAL                       |
| url         | Url of the callback                                        | String         | COMPULSORY                     |
| authType    | Authentication type                                        | String         | COMPULSORY                     |
| headers     | Necessary headers required for the Auth type               | List of Object | COMPULSORY                     |
| key         | Header key name                                            | String         | COMPULSORY                     |
| value       | Header key value                                           | String         | COMPULSORY                     |

### Sample Status Codes And Messages

:::CodeblockTabs
200 OK

```json
{
    "result": {
        "callbacks": [
            {
                "url": "https://client-global-callback.url",
                "authType": "key-auth",
                "headers": [
                    {
                        "key": "Authorization",
                        "value": "QWERTYUIOP"
                    }
                ]
            }
        ]
    }
}
```

409

```json
{
    "error": {
        "name": "error",
        "message": "Error in getting data from Upstream",
        "status": 409,
        "reason": "Error",
        "type": "Conflict",
        "statusCode": 409
    }
}
```

400

```json
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "\"consumerId\" is not allowed to be empty",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}

1. Datatype validation issues errors, eg: \"consumerId\" must be a string
2. \"apiName\" must adhere to the following pattern - /^(\/[a-zA-Z0-9-]+)+$/

```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "status": 500,
        "reason": "ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```
:::

***



