---
title: "Modify features in the space"
method: POST
path: "/spaces/{spaceId}/features"
tags: ["Write Features"]
---

# Modify features in the space

`POST /spaces/{spaceId}/features`

This method allows to create, update and delete features. The behavior of the POST handler is controlled by three query parameters described in detail below. The name of the parameter reflects a condition to be matched. Its value reflects the corresponding action to be performed for this case.

If no values are provided, the request is handled with the default values:

```

ne=create&e=patch&transactional=true

```

The three parameters and their possible values are:

### _ne_ - If Not Exists

If no feature with the provided ID exists, or if the provided feature contains no ID, then one of the following actions can be used:

* __create__  (default) - A new object is created.

* __retain__ - No action is executed, allowing the execution of the batch operation to continue, even if the _transactional_ parameter is set to _true_.

* __error__ - If no object with the provided ID exists, an error is raised, which would result in the whole batch operation to be aborted, if the _transactional_ parameter is set to _true_.

### _e_ - If Exists

If an object with the provided ID exists, and _history_ is enabled for the space, there are 2 states which could be taken into account:

    1. The __ORIGIN__ state - the state that the client received and modified. The state is retrieved by using the value of the NS attribute _version_.

    2. The __HEAD__ state - the current state of the object in the space, including any changes applied to it in the meantime.


The possible operations in detail:

* __patch__  (default) - The feature object is handled as a _partial update object_. Therefore it could contain only the properties, which should be modified. Properties, which do not exist in the HEAD state of the object are inserted, the values for all existing properties are updated, unless the value of the property is set to _null_ , which will result in the property being removed from the object.

    If an _ORIGIN_ state is specified in the _partial update object_ and it is not the same as the _HEAD_ state, the patch is applied to the _HEAD_ state, but only in case that the differnce between _ORIGIN_ and _HEAD_ contains no conflicting changes( i.e. only different properties were modified ). Otherwise an error is raised, which will result in the batch operation being aborted, if the _transactional_ parameter is set to _true_.

* __replace__ - If an object with the provided ID exists, it will be replaced with the provided feature object. If the _ORIGIN_ state is specified in the provided feature and differs from the _HEAD_ state, then a error is raised.

* __merge__ - The provided feature object is handled as a full object version and not a partial update. If an _ORIGIN_ state is specified in the feature and it is not the same as the _HEAD_ state, the difference between the _ORIGIN_ state and provided version to the _HEAD_ state, but only in the case that the difference between _ORIGIN_ and _HEAD_ contains no conflicting changes. Otherwise an error is raised, which will result in the batch operation being aborted, if the _transactional_ parameter is set to _true_.

* __delete__ - The feature with the provided is deleted.

* __retain__ - The current state of the feature is retained and included in the response.

* __error__ - Raises an error, if the object already exists.

### transactional - Transactional batch operation

Defines, if modifying of the features, is executed as a single transactional batch operation (_true_:default) or as independent operations (_false_).
There is a limit of 10 megs of data allowed for this operation.

## Path parameters

- `spaceId` string, required

## Query parameters

- `e` 'patch' | 'replace' | 'merge' | 'delete' | 'retain' | 'error'
- `ne` 'retain' | 'error' | 'create'
- `cr` 'error' | 'retain' | 'replace'
- `transactional` boolean
- `prefixId` string
- `context` 'default' | 'extension' | 'super'
- `versionRef` string

## Response `200`

An array of features and their modifications response.

## Other responses

- `204` — An empty response as a result of a user-request with accepted MIME type application/x-empty.
- `400` — Malformed or Bad Request.
- `401` — Unauthorized to perform the request.
- `403` — Forbidden request. Insufficient rights to perform the request.
- `404` — Not found.
- `409` — An error response which indicates a conflict.
- `413` — Request entity too large.
- `513` — Response payload too large.

---

[API](https://skmtc.net/here/apis/here-xyz-hub.md) · [All operations](https://skmtc.net/here/apis/here-xyz-hub/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/here/here-xyz-hub/revisions/1c6c6a2bcac9/schema)
