# setContactRelationshipRole

The RELATIONSHIP role (Spouse) of a related person's link to their main contact; `contactId` is the related person (getContact relatedPeople). roleId null clears the role AND the relation text. An Only-one role moves off its previous holder.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "setContactRelationshipRole", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `contactId`: `ID!` (required)
- `roleId`: `ID`

## Response (data, an example)

```json
{
  "contactMutation": {
    "setContactRelationshipRole": {
      "id": "<ID>",
      "relationshipRole": {
        "id": "<ID>",
        "name": "…"
      },
      "relatedTo": {
        "mainContactId": "<ID>",
        "mainContactName": "…",
        "relation": "…"
      }
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "setContactRelationshipRole",
    "variables": {
      "contactId": "<contactId>"
    }
  }'
```
