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

`POST /rest/api/space/{spaceKey}/property`

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

space property to be created

- `key` (string)
- `value` (JsonString)
- `version` (Version)
- `space` (Space)
- `spaceRef` (ReferenceSpace)

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": {}
    }
  },
  "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": {}
    }
  },
  "spaceRef": {
    "expanded": true,
    "idProperties": {}
  }
}
```

**Responses**

- `200` — Returns a full JSON representation of the space property.
- `400` — Returned if the space already has a value with the given key, or no property value was provided, or the value is too long.
- `403` — Returned if the user does not have permission to edit the space with the given key.
- `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": {}
    }
  },
  "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": {}
    }
  },
  "spaceRef": {
    "expanded": true,
    "idProperties": {}
  }
}
```
