> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/undo/_apply.md).

# \_apply

Applies an object version's data onto that object. (Currently only works with Form versions)

### Parameters

#### id

The ID of the version being applied to an object.

#### obj\_id

The ID of the object which is being modified.

#### obj\_type

The type of object being modified by this function, currently only Form objects.

### Example

```
FM_api('Undo_apply', [
    'id'=>'90002',
    'obj_id'=>'580335',
    'obj_type'=>'forms'
    ]
);
```

### Result

#### On Success

```
{"ok":1}
```

#### On Failure

If the "id" parameter is not set or has a value less than 1:

```
{"error":"missing or invalid parameter: id"}
```

If the "obj\_id" parameter is not set or has a value less than 1:

```
{"error":"missing or invalid parameter: obj_id"}
```

If "obj\_type" parameter is not set or does not have the value "forms":

```
{"error":"invalid obj_type"}
```

If a version is not found which fits the "id", "obj\_id" and "obj\_type" parameters:

```
{"error":"undo entry does not exist"}
```
