# setKeyValue

Audience: Programmer

**Served by:** [management](https://docs.pyck.cloud/latest/api/services/management.md)

## Arguments

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `input` | [SetKeyValueInput](https://docs.pyck.cloud/latest/api/inputs/setkeyvalueinput.md)! |  |  |

## Returns

[KeyValue](https://docs.pyck.cloud/latest/api/types/keyvalue.md)

## Example

Creates or updates a key-value entry for the current user.

```graphql
mutation SetKeyValue($input: SetKeyValueInput!) {
  setKeyValue(input: $input) {
    createdAt
    createdBy
    data
    dataTypeID
    dataTypeSlug
    deletedAt
    deletedBy
    id
    name
    tenantID
    updatedAt
    updatedBy
    userID
  }
}
```

**Variables**

```json
{
  "input": {
    "data": "{\"theme\":\"dark\",\"density\":\"compact\"}",
    "name": "ui.theme"
  }
}
```
