> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update my workspace membership

> Edit the signed-in user's own title on a workspace

## Overview

`useUpdateMyWorkspaceMembership` returns a callable that edits the **signed-in user's own** `title` on a workspace.

**Authorization:** self-service, no capability needed.

Only `title` can be edited here. A member's other fields (`metadata`, `capabilities`, `permissions`, rank) are edited by a member with the capability, through [`useUpdateWorkspaceMember`](https://docs.sublay.io/v8/hooks/workspaces/use-update-workspace-member).

You must hold a direct member row on the workspace. The workspace **owner has no member row**, so they have no title and get `404 workspace/not-found`; so does a user who only reaches in from an ancestor workspace.

Your own membership is `/workspaces/:workspaceId/members/me`: [`useFetchMyWorkspaceMembership`](https://docs.sublay.io/v8/hooks/workspaces/use-fetch-my-workspace-membership) reads it, this hook edits your title, and [`useLeaveWorkspace`](https://docs.sublay.io/v8/hooks/workspaces/use-leave-workspace) leaves it.

## Usage Example

```tsx theme={null}
import { useUpdateMyWorkspaceMembership } from "@sublay/react-js";

function MyTitle({ workspaceId }: { workspaceId: string }) {
  const updateMyWorkspaceMembership = useUpdateMyWorkspaceMembership();

  const save = async (title: string) => {
    const member = await updateMyWorkspaceMembership({ workspaceId, title });
    console.log("Title is now:", member.title);
  };

  const clear = () => updateMyWorkspaceMembership({ workspaceId, title: null });
}
```

## Parameters

**workspaceId** `string` *required*

The workspace UUID.

**title** `string | null` *required*

Your new title: trimmed, up to 100 characters. `null` clears it.

## Returns

`Promise<WorkspaceMember>` — your updated [WorkspaceMember](https://docs.sublay.io/v8/data-models/workspace-member.md) record, the same type [`useUpdateWorkspaceMember`](https://docs.sublay.io/v8/hooks/workspaces/use-update-workspace-member) resolves to.

## Error codes

| Code | Status | Meaning |
| - | - | - |
| `workspace/invalid-body` | 400 | `title` is missing, not a string or `null`, or longer than 100 characters. |
| `workspace/invalid-params` | 400 | `workspaceId` isn't a UUID. |
| `workspace/not-found` | 404 | No such workspace, you have no relation to it, or you hold no member row on it (for example, you are its owner). |

## Related

* [`useFetchMyWorkspaceMembership`](https://docs.sublay.io/v8/hooks/workspaces/use-fetch-my-workspace-membership) — read your own standing
* [`useUpdateWorkspaceMember`](https://docs.sublay.io/v8/hooks/workspaces/use-update-workspace-member) — edit another member
* [Update My Membership API](https://docs.sublay.io/v8/api-reference/workspaces/members/update-my-membership.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.