# Replace table-preferences tableKey

Saves how the signed-in person has arranged one grid. `tableKey` must be namespaced, like `table:deals:overview`; body: `columnOrder` and `hiddenColumns` as column ids (at most 200 each, and empty legitimately means unset — no order is the table's own order), `sortColumn` with `sortDirection`, and `groupColumn`. The WHOLE layout is replaced rather than patched, because a column order is only meaningful entire and a patch could not tell "I cleared my sort" from "I did not mention it". Written by the grid itself; `delete_table-preferences_tableKey` resets it to the workspace default.

Access class: `workspace`.

## Endpoint

`PUT /v1/table-preferences/{tableKey}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| tableKey | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "columnOrder": [
      "string"
    ],
    "groupColumn": "string",
    "hiddenColumns": [
      "string"
    ],
    "sortColumn": "string",
    "sortDirection": "string"
  },
  "params": {
    ":tableKey": "string"
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "columnOrder": [
      "string"
    ],
    "groupColumn": "string",
    "hiddenColumns": [
      "string"
    ],
    "sortColumn": "string",
    "sortDirection": "string",
    "tableKey": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
