---
title: "Add metadata to doc group"
url: "https://docs.signnow.com/docs/document-group/operations/put-v2-document-groups-document_group_id-metadata"
type: "endpoint"
section: "document-group"
slug: "document-group/operations/put-v2-document-groups-document_group_id-metadata"
method: "PUT"
path: "/v2/document-groups/{document_group_id}/metadata"
operation_id: "put-v2-document-groups-document_group_id-metadata"
authorization: "bearer"
---

# Add metadata to doc group

`PUT /v2/document-groups/{document_group_id}/metadata`

This endpoint allows users to add metadata to the selected document group. All added metadata will be linked to the document group during the [invite to sign](/docs/document-field-invite/operations/post-field_invite). Also, if you'd like to use this metadata in any event subscription, you can add upon [creating a webhook](/docs/basic-auth/operations/create-event-subscription).

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_group_id` | string | Yes | ID of the document group. |

## Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Content-Type` | string | No | application/json |

## Request Body

**Schema**

```json
{
  "type": "object",
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Any type of metadata that should be added to the document group. For example,`signer_id`."
        },
        "key1": {
          "type": "string",
          "description": "Any type of metadata that should be added to the document group. For example, `timestamp`."
        },
        "key2": {
          "type": "string",
          "description": "Any type of metadata that should be added to the document group. For example, `document_group_owner_id`."
        }
      },
      "description": "Array of the keys to be added to the metadata."
    }
  },
  "x-examples": {
    "Example 1": {
      "content": {
        "key": "value",
        "key1": "value",
        "key2": "value"
      }
    }
  }
}
```

**Example** (`Example 1`)

```json
{
  "content": {
    "key": "value",
    "key1": "value",
    "key2": "value"
  }
}
```

## Responses

### 204

Success, no content

### 400

Incorrect or missing token* Request with invalid payload
* Request with empty payload.
* Request with `content` which is not an array
* Request with `content` which is more than 20 elements
* Request with empty `content`
* Request with `key` which is not a string
* Request with `key` empty
* Request with `key` which is more than 100 chars
* Request with `key` with a special char
* Request with `key value` which is not a string
* Request with `key value` empty
* Request with `key value` which is more than 100 chars
* Request with `key value` with a 4-byte symbol

**Example** (`Request with `key` empty`)

```json
{
  "errors": [
    {
      "code": 23004006,
      "message": "The keys of the `content` field must not be empty."
    }
  ]
}
```

**Example** (`Incorrect or missing token`)

```json
{
  "code": 1537,
  "error": "invalid_token"
}
```

**Example** (`Request with empty content`)

```json
{
  "errors": [
    {
      "code": 23004003,
      "message": "The `content` field must not be empty."
    }
  ]
}
```

**Example** (`Request with empty payload`)

```json
{
  "errors": [
    {
      "code": 23004001,
      "message": "The `content` field is required."
    }
  ]
}
```

**Example** (`Request with invalid payload`)

```json
{
  "errors": [
    {
      "code": 65536,
      "message": "Invalid payload"
    }
  ]
}
```

**Example** (`Request with `key value` empty`)

```json
{
  "errors": [
    {
      "code": 23004010,
      "message": "The values of the `content` field must not be empty."
    }
  ]
}
```

**Example** (`Request with `key` with a special char`)

```json
{
  "errors": [
    {
      "code": 23004008,
      "message": "The keys of the `content` field must contain only letters, numbers, underscores and hyphens."
    }
  ]
}
```

**Example** (`Request with `key` which is not a string`)

```json
{
  "errors": [
    {
      "code": 23004005,
      "message": "The keys of the `content` field must be strings."
    }
  ]
}
```

**Example** (`Request with `content` which is not an array`)

```json
{
  "errors": [
    {
      "code": 23004002,
      "message": "The `content` field must be an array."
    }
  ]
}
```

**Example** (`Request with `key value` with a 4-byte symbol`)

```json
{
  "errors": [
    {
      "code": 23004012,
      "message": "The values of the `content` field must not contain 4-byte characters."
    }
  ]
}
```

**Example** (`Request with `key` value which is not a string`)

```json
{
  "errors": [
    {
      "code": 23004009,
      "message": "The values of the `content` field must be strings."
    }
  ]
}
```

**Example** (`Request with `key` which is more than 100 chars`)

```json
{
  "errors": [
    {
      "code": 23004007,
      "message": "The keys of the `content` field must contain no more than 100 characters."
    }
  ]
}
```

**Example** (`Request with `content` which is more than 20 elements`)

```json
{
  "errors": [
    {
      "code": 23004004,
      "message": "The `content` field must contain no more than 20 elements."
    }
  ]
}
```

**Example** (`Request with `key value` which is more than 100 chars`)

```json
{
  "errors": [
    {
      "code": 23004011,
      "message": "The values of the `content` field must contain no more than 100 characters."
    }
  ]
}
```

### 403

* Request with `group_id` in trash
* Request with `group_id` archieved
* Request with bearer token from another user

**Example** (`Request with `group_id` in trash`)

```json
{
  "errors": [
    {
      "code": 13020066,
      "message": "Cannot access the document group while it is in the trash bin."
    }
  ]
}
```

**Example** (`Request with `group_id` archieved`)

```json
{
  "errors": [
    {
      "code": 13020065,
      "message": "Cannot access the document group while it is in the archive folder."
    }
  ]
}
```

**Example** (`Request with bearer token from another user`)

```json
{
  "errors": [
    {
      "code": 13020008,
      "message": "Access to DocumentGroup is denied"
    }
  ]
}
```

### 404

* Request with `group_id` which does not exist
* Request with `group_id` which is a template

**Example** (`Request with `group_id` which is a template`)

```json
{
  "message": "Document group `4fXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` not found"
}
```

**Example** (`Request with `group_id` which does not exist`)

```json
{
  "errors": [
    {
      "message": "Document group `4fXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` not found"
    }
  ]
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X PUT \
  "https://api.signnow.com/v2/document-groups/{document_group_id}/metadata" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content": {"key": "value", "key1": "value", "key2": "value"}}'
```

---
*Full reference: https://docs.signnow.com/docs/document-group/operations/put-v2-document-groups-document_group_id-metadata*
