---
title: Post Metadata
slug: api-marketplace/post-metadata
createdAt: 2024-02-08T08:30:17.849Z
---

### Introduction

This API is responsible for posting metadata for a given Consumer ID. Here, users can post metadata under global namespace as well as API specific namespace. If partial metadata are present for a particualar API, then global namespace serves as the fallback config provider for the remaining metadata.

### cURL

:::CodeblockTabs
Production

```curl
curl --location 'https://api.signzy.app/api/v3/metahub/post-metadata' \
--header 'Authorization: <Access-Token>' \
--header 'Content-Type: application/json' \
--data '{
    "consumerId": "consumer123",
    "global": {
        "callbacks": [
            {
                "url": "https://client-global-callback.url",
                "authType": "key-auth",
                "headers": [
                    {
                        "key": "Authorization",
                        "value": "QWERTYUIOP"
                    }
                ]
            }
        ]
    },
    "apis": [
        {
            "apiName": "/gstr-analytics/create-request",
            "metadata": {
                "callbacks": [
                    {
                        "url": "https://client-api-specific-callback.url",
                        "authType": "key-auth",
                        "headers": [
                            {
                                "key": "Authorization",
                                "value": "ZXCVBNM"
                            }
                        ]
                    }
                ]
            }
        }
    ]
}'
```

Pre-Production

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/metahub/post-metadata' \
--header 'Authorization: <Access-Token>' \
--header 'Content-Type: application/json' \
--data '{
    "consumerId": "consumer123",
    "global": {
        "callbacks": [
            {
                "url": "https://client-global-callback.url",
                "authType": "key-auth",
                "headers": [
                    {
                        "key": "Authorization",
                        "value": "QWERTYUIOP"
                    }
                ]
            }
        ]
    },
    "apis": [
        {
            "apiName": "/gstr-analytics/create-request",
            "metadata": {
                "callbacks": [
                    {
                        "url": "https://client-api-specific-callback.url",
                        "authType": "key-auth",
                        "headers": [
                            {
                                "key": "Authorization",
                                "value": "ZXCVBNM"
                            }
                        ]
                    }
                ]
            }
        }
    ]
}'
```
:::

### Request Headers

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

### Request Body

```json
{
    "consumerId": "consumer123",
    "global": {
        "callbacks": [
            {
                "url": "https://client-global-callback.url",
                "authType": "key-auth",
                "headers": [
                    {
                        "key": "Authorization",
                        "value": "QWERTYUIOP"
                    }
                ]
            }
        ]
    },
    "apis": [
        {
            "apiName": "/gstr-analytics/create-request",
            "metadata": {
                "callbacks": [
                    {
                        "url": "https://client-api-specific-callback.url",
                        "authType": "key-auth",
                        "headers": [
                            {
                                "key": "Authorization",
                                "value": "QWERTYUIOP"
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
```

| PARAMETERS  | DESCRIPTION                                                  | TYPE           | VALUE (COMPULSORY OR OPTIONAL) |
| ----------- | ------------------------------------------------------------ | -------------- | ------------------------------ |
| consumerId  | A unique id shared by Signzy during onboarding of the client | String         | COMPULSORY                     |
| global      | Fallback metadata config                                     | Object         | COMPULSORY                     |
| apis        | API specific metadata config                                 | List of Object | OPTIONAL                       |
| apiName     | Name of the API                                              | String         | COMPULSORY                     |
| metadata    | Metadata for the API                                         | Object         | COMPULSORY                     |
| 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                     |

### Response Data

:::CodeblockTabs
200 OK

```json
{
    "result": {
        "consumerId": "consumer123",
        "message": "Metadata has been successfully stored"
    }
}
```
:::

| PARAMETERS | DESCRIPTION                                                       | TYPE   | VALUE (COMPULSORY OR OPTIONAL) |
| ---------- | ----------------------------------------------------------------- | ------ | ------------------------------ |
| result     | This parameter contains the actual output.                        | Object | COMPULSORY                     |
| consumerId | A unique id shared by Signzy during onboarding of the client      | String | COMPULSORY                     |
| message    | It indicates whether metadata has been successfully stored or not | String | COMPULSORY                     |

### Sample Status Codes And Messages

:::CodeblockTabs
200 OK

```json
{
    "result": {
        "consumerId": "consumer123",
        "message": "Metadata has been successfully stored"
    }
}
```

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": "\"global.callbacks[0].url\" is required",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}

1. Datatype validation issues errors, eg: \"consumerId\" must be a string
2. Missing required parameters, eg: \"global\" is required
3. \"apiName\" must adhere to the following pattern - /^(\/[a-zA-Z0-9-]+)+$/
4. \"callbacks[n].url\" must be a valid uri
5. \"authType\" must be one of [key-auth, basic-auth, bearer-auth]

```

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
    }
}
```
:::

***



