---
title: userSetMetadata query | Wartiva GraphQL API
description: Stores a value under a key in the caller's own key-value metadata store, replacing any existing value, and returns the stored key and value.
url: https://wartiva.com/api-docs/queries/user-set-metadata.html
updated: 2026-10-07
---

Organizations and users · GraphQL query

# `userSetMetadata` query

Stores a value under a key in the caller's own key-value metadata store, replacing any existing value, and returns the stored key and value. Each user can hold up to 4096 keys; overwriting an existing key is always allowed. Read values back with [userGetMetadata](https://wartiva.com/api-docs/queries/user-get-metadata.html). This operation writes data even though it is declared as a query.

## Response

Returns a [`UserMetadataPayload!`](https://wartiva.com/api-docs/types/user-metadata-payload.html)

## Arguments

| Name | Description |
|---|---|
| `key` - [`String!`](https://wartiva.com/api-docs/types/string.html) | The metadata key, 1 to 256 bytes. |
| `value` - [`Binary!`](https://wartiva.com/api-docs/types/binary.html) | The value to store, up to 256 KiB. |

## Example

### Query

```graphql
query userSetMetadata(
  $key: String!,
  $value: Binary!
) {
  userSetMetadata(
    key: $key,
    value: $value
  ) {
    key
    value
  }
}

```

### Variables

```json
{
  "key": "abc123",
  "value": Binary
}

```

### Response

```json
{
  "data": {
    "userSetMetadata": {
      "key": "abc123",
      "value": Binary
    }
  }
}

```

---

Wartiva is in early access. Request access: https://wartiva.com/early-access.html  
All pages: https://wartiva.com/llms.txt
