# at.ducs.relationships.setRelationship

> Published by [ducs.at](https://lexicon.garden/identity/did:plc:c5ljrscuf2xu4oovnafzoqlg)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:c5ljrscuf2xu4oovnafzoqlg/at.ducs.relationships.setRelationship)
- [Documentation](https://lexicon.garden/lexicon/did:plc:c5ljrscuf2xu4oovnafzoqlg/at.ducs.relationships.setRelationship/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:c5ljrscuf2xu4oovnafzoqlg/at.ducs.relationships.setRelationship/examples)

## Definitions

### `at.ducs.relationships.setRelationship`

**Type**: `procedure`

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `ref` → `at.ducs.relationships.setRelationship#type` | Yes |  |
| `userId` | `string` (at-identifier) | Yes |  |

#### Output

**Encoding**: `application/json`

#### Errors

- **relationshipUpdateFailed**
- **relationshipNotUpdated**
- **userNotFound**

### `at.ducs.relationships.setRelationship#type`

**Type**: `string`

**Allowed Values**:
- `friend`
- `blocked`
- `unrelated`

## Raw Schema

```json
{
  "id": "at.ducs.relationships.setRelationship",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "userId",
            "type"
          ],
          "properties": {
            "type": {
              "ref": "at.ducs.relationships.setRelationship#type",
              "type": "ref"
            },
            "userId": {
              "type": "string",
              "format": "at-identifier"
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "relationshipUpdateFailed"
        },
        {
          "name": "relationshipNotUpdated"
        },
        {
          "name": "userNotFound"
        }
      ],
      "output": {
        "schema": {
          "ref": "at.ducs.relationships.defs#relationship",
          "type": "ref"
        },
        "encoding": "application/json"
      }
    },
    "type": {
      "enum": [
        "friend",
        "blocked",
        "unrelated"
      ],
      "type": "string"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
