---
title: "Set a follow or mute relationship with a durable receipt"
method: POST
path: "/v1/users/relationships/commands"
tags: ["following"]
---

# Set a follow or mute relationship with a durable receipt

`POST /v1/users/relationships/commands`

## Request

- Base URL: `https://app.legend.trade/api/rest`
- URL: `https://app.legend.trade/api/rest/v1/users/relationships/commands`
- Auth: HTTP bearer

## Request body

- object
  - `operationId` string, uuid, required: Persist this UUID and input before transport. Retry the same pair after an unknown outcome. A new intent needs a new UUID.
  - `expectedUserId` string, uuid, required: The Legend account UUID that owns this command.
  - `targetId` string, uuid, required
  - `kind` 'setFollowing' | 'setMuted', required
  - `enabled` boolean, required

## Response `200`

Successful response

- RelationshipCommandReceipt
  - `operationId` string, uuid, required
  - `status` 'succeeded' | 'rejected', required
  - `result` RelationshipSnapshot, required: One database snapshot. Private relationship fields belong only to viewerId. This snapshot has no event cursor or server revision.
    - `viewerId` string, uuid, required
    - `viewerStats` object, required
      - `followers` integer, required
      - `following` integer, required
    - `users` object[], required
      - `userId` string, uuid, required
      - `isFollowing` boolean, required
      - `followsYou` boolean, required
      - `isMuted` boolean, required
      - `followers` integer, required
      - `following` integer, required
    - `unavailableUserIds` string[], required
  - `error` object, nullable, required
    - `code` string, required
    - `message` string, required

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `500`: Internal server error

## Changes

- **2026-10-24** `47071fafc154`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/legend/apis/legend-api/changes/v1/users/relationships/commands/post.md)

---

[API](https://skmtc.dev/legend/apis/legend-api.md) - [All operations](https://skmtc.dev/legend/apis/legend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/legend/apis/legend-api/revisions/c3e45061cf81?raw)
