---
ai:
  exclude: true
search:
  tags:
    - Content Property
    - POST
seo:
  description: >-
    Creates a new content property. Reference for the POST
    /rest/api/content/{id}/property endpoint in the Confluence Data Center API.
sidebar:
  label: Create a content property
  badge: POST
title: Create a content property
type: openapi-operation
---
Creates a new content property.

`POST /rest/api/content/{id}/property`

**Request body** (`application/json`)

content property to be created.

- `key` (string)
- `value` (JsonString)
- `version` (Version)
- `id` (string)
- `content` (Content)
- `contentRef` (ReferenceContent)

Request body example:

```json
{
  "key": "string",
  "value": {
    "value": "string"
  },
  "version": {
    "by": {
      "profilePicture": {
        "path": "http://www.example.com/path/to/image.png",
        "width": 16,
        "height": 16,
        "isDefault": true
      },
      "displayName": "Joe Smith",
      "type": "string"
    },
    "when": "2020-01-01T00:00:00Z",
    "message": "A message",
    "number": 1,
    "minorEdit": true,
    "hidden": true,
    "syncRev": "123456",
    "content": {
      "expanded": true,
      "idProperties": {}
    },
    "contentRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "id": "string",
  "content": {
    "id": "123456",
    "type": "page",
    "status": "current",
    "title": "My Page",
    "links": {},
    "space": {
      "id": 123456,
      "key": "TEST",
      "name": "Test Space",
      "status": "current",
      "icon": {
        "expanded": true,
        "idProperties": {}
      },
      "description": {},
      "homepage": {
        "expanded": true,
        "idProperties": {}
      },
      "links": {},
      "type": "global",
      "metadata": {
        "labels": [
          "label1",
          "label2"
        ]
      },
      "retentionPolicy": {
        "expanded": true,
        "idProperties": {}
      }
    },
    "history": {
      "previousVersion": {
        "expanded": true,
        "idProperties": {}
      },
      "nextVersion": {
        "expanded": true,
        "idProperties": {}
      },
      "lastUpdated": {
        "expanded": true,
        "idProperties": {}
      },
      "latest": true,
      "createdBy": {
        "profilePicture": {
          "path": "http://www.example.com/path/to/image.png",
          "width": 16,
          "height": 16,
          "isDefault": true
        },
        "displayName": "Joe Smith",
        "type": "string"
      },
      "createdDate": "2020-01-01T00:00:00Z",
      "contributors": {
        "expanded": true,
        "idProperties": {}
      },
      "lastUpdatedRef": {
        "expanded": true,
        "idProperties": {}
      },
      "nextVersionRef": {
        "expanded": true,
        "idProperties": {}
      },
      "previousVersionRef": {
        "expanded": true,
        "idProperties": {}
      },
      "contentParentRef": {
        "expanded": true,
        "idProperties": {}
      }
    },
    "version": {
      "by": {
        "profilePicture": {
          "path": "http://www.example.com/path/to/image.png",
          "width": 16,
          "height": 16,
          "isDefault": true
        },
        "displayName": "Joe Smith",
        "type": "string"
      },
      "when": "2020-01-01T00:00:00Z",
      "message": "A message",
      "number": 1,
      "minorEdit": true,
      "hidden": true,
      "syncRev": "123456",
      "content": {
        "expanded": true,
        "idProperties": {}
      },
      "contentRef": {
        "expanded": true,
        "idProperties": {}
      }
    },
    "ancestors": [
      {}
    ],
    "position": 1,
    "operations": [
      {
        "operation": "read",
        "targetType": "page"
      }
    ],
    "children": {},
    "descendants": {},
    "container": null,
    "body": {},
    "metadata": {
      "key": "value"
    },
    "extensions": {
      "key": "value"
    },
    "restrictions": {
      "use": {
        "operation": "use",
        "restrictions": []
      }
    },
    "historyRef": {
      "expanded": true,
      "idProperties": {}
    },
    "spaceRef": {
      "expanded": true,
      "idProperties": {}
    },
    "containerRef": {
      "expanded": true,
      "idProperties": {}
    },
    "versionRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "contentRef": {
    "expanded": true,
    "idProperties": {}
  }
}
```

**Responses**

- `200` — Returns a full JSON representation of the content property.
- `400` — Returned if the given property has a different ContentId to the one in the path, or if the content already has a value with the given key, or the value is missing, or the value is too long.
- `403` — Returned if the user does not have permission to edit the content with the given ContentId.
- `413` — Returned if the value is too long.

Response example, 200:

```json
{
  "key": "string",
  "value": {
    "value": "string"
  },
  "version": {
    "by": {
      "profilePicture": {
        "path": "http://www.example.com/path/to/image.png",
        "width": 16,
        "height": 16,
        "isDefault": true
      },
      "displayName": "Joe Smith",
      "type": "string"
    },
    "when": "2020-01-01T00:00:00Z",
    "message": "A message",
    "number": 1,
    "minorEdit": true,
    "hidden": true,
    "syncRev": "123456",
    "content": {
      "expanded": true,
      "idProperties": {}
    },
    "contentRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "id": "string",
  "content": {
    "id": "123456",
    "type": "page",
    "status": "current",
    "title": "My Page",
    "links": {},
    "space": {
      "id": 123456,
      "key": "TEST",
      "name": "Test Space",
      "status": "current",
      "icon": {
        "expanded": true,
        "idProperties": {}
      },
      "description": {},
      "homepage": {
        "expanded": true,
        "idProperties": {}
      },
      "links": {},
      "type": "global",
      "metadata": {
        "labels": [
          "label1",
          "label2"
        ]
      },
      "retentionPolicy": {
        "expanded": true,
        "idProperties": {}
      }
    },
    "history": {
      "previousVersion": {
        "expanded": true,
        "idProperties": {}
      },
      "nextVersion": {
        "expanded": true,
        "idProperties": {}
      },
      "lastUpdated": {
        "expanded": true,
        "idProperties": {}
      },
      "latest": true,
      "createdBy": {
        "profilePicture": {
          "path": "http://www.example.com/path/to/image.png",
          "width": 16,
          "height": 16,
          "isDefault": true
        },
        "displayName": "Joe Smith",
        "type": "string"
      },
      "createdDate": "2020-01-01T00:00:00Z",
      "contributors": {
        "expanded": true,
        "idProperties": {}
      },
      "lastUpdatedRef": {
        "expanded": true,
        "idProperties": {}
      },
      "nextVersionRef": {
        "expanded": true,
        "idProperties": {}
      },
      "previousVersionRef": {
        "expanded": true,
        "idProperties": {}
      },
      "contentParentRef": {
        "expanded": true,
        "idProperties": {}
      }
    },
    "version": {
      "by": {
        "profilePicture": {
          "path": "http://www.example.com/path/to/image.png",
          "width": 16,
          "height": 16,
          "isDefault": true
        },
        "displayName": "Joe Smith",
        "type": "string"
      },
      "when": "2020-01-01T00:00:00Z",
      "message": "A message",
      "number": 1,
      "minorEdit": true,
      "hidden": true,
      "syncRev": "123456",
      "content": {
        "expanded": true,
        "idProperties": {}
      },
      "contentRef": {
        "expanded": true,
        "idProperties": {}
      }
    },
    "ancestors": [
      {}
    ],
    "position": 1,
    "operations": [
      {
        "operation": "read",
        "targetType": "page"
      }
    ],
    "children": {},
    "descendants": {},
    "container": null,
    "body": {},
    "metadata": {
      "key": "value"
    },
    "extensions": {
      "key": "value"
    },
    "restrictions": {
      "use": {
        "operation": "use",
        "restrictions": []
      }
    },
    "historyRef": {
      "expanded": true,
      "idProperties": {}
    },
    "spaceRef": {
      "expanded": true,
      "idProperties": {}
    },
    "containerRef": {
      "expanded": true,
      "idProperties": {}
    },
    "versionRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "contentRef": {
    "expanded": true,
    "idProperties": {}
  }
}
```
