> ## 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.

# Fetch my workspace membership

> The signed-in user's own full standing on a workspace

## Overview

`useFetchMyWorkspaceMembership` returns a callable that reads the **signed-in user's own** standing on a workspace — the same record [`useFetchWorkspaceMemberStanding`](https://docs.sublay.io/v8/hooks/workspaces/use-fetch-workspace-member-standing) returns for another user, and one roster row's shape.

**Authorization:** self-service. Any signed-in user may call it for any workspace: it is not gated by roster visibility, so a user with no relation to the workspace gets a record with `reasons: []` rather than an error. Your own access is never fenced: `capabilities`, `permissions`, `rank` and `relativeRank` are always present.

Your own membership is `/workspaces/:workspaceId/members/me`: this hook reads it, [`useUpdateMyWorkspaceMembership`](https://docs.sublay.io/v8/hooks/workspaces/use-update-my-workspace-membership) edits your title, and [`useLeaveWorkspace`](https://docs.sublay.io/v8/hooks/workspaces/use-leave-workspace) leaves it. Hooks that take a user id ([`useFetchWorkspaceMemberStanding`](https://docs.sublay.io/v8/hooks/workspaces/use-fetch-workspace-member-standing), [`useUpdateWorkspaceMember`](https://docs.sublay.io/v8/hooks/workspaces/use-update-workspace-member), [`useRemoveWorkspaceMember`](https://docs.sublay.io/v8/hooks/workspaces/use-remove-workspace-member), [`useRemoveWorkspaceMemberFromSubtree`](https://docs.sublay.io/v8/hooks/workspaces/use-remove-workspace-member-from-subtree)) act on other members and refuse your own id.

## Usage Example

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

function MyRole({ workspaceId }: { workspaceId: string }) {
  const fetchMyWorkspaceMembership = useFetchMyWorkspaceMembership();

  const load = async () => {
    const me = await fetchMyWorkspaceMembership({ workspaceId });
    if (me.reasons.length === 0) {
      // No standing on this workspace at all.
    }
    // me.capabilities, me.permissions, me.rank, me.relativeRank are always present here.
  };
}
```

## Parameters

**workspaceId** `string` *required*

The workspace UUID.

## Returns

`Promise<WorkspaceMemberStanding>` — the record itself:

| Field | Type | Description |
| - | - | - |
| `user` | `WorkspaceStandingUser` | You. |
| `reasons` | `WorkspaceAuthorityReasonDetail[]` | Why you have standing — structured `{ type, viaWorkspaceId? }` entries. Empty when you have no relation to the workspace. |
| `capabilities` | `string[]` | Your **resolved** capability set (direct + reach + ownership). **`view` is implied by every other capability.** |
| `permissions` | `string[]` | Your **per-node** permissions (direct membership on this workspace only; may be empty). |
| `rank` | `number \| null` | Your direct-membership rank, or `null` when you hold no member row here (an owner, an ancestor-owner or a reach-only holder). |
| `relativeRank` | `number \| null` | `0` when you hold a member row here (you are measured from yourself), `null` when you don't. |
| `title` | `string \| null` | Your cosmetic title on this workspace. |
| `metadata` | `Record<string, any>` | Your member metadata. |

The type is the shared `WorkspaceMemberStanding`, where the four authority fields are optional because another user's standing may be fenced; on this read they are always set.

## Error codes

| Code | Status | Meaning |
| - | - | - |
| `workspace/invalid-params` | 400 | `workspaceId` isn't a UUID. |
| `workspace/not-found` | 404 | No such workspace in this project. |

## Related

* [`useFetchWorkspaceMemberStanding`](https://docs.sublay.io/v8/hooks/workspaces/use-fetch-workspace-member-standing) — the same record for another user
* [`useFetchWorkspaceAuthority`](https://docs.sublay.io/v8/hooks/workspaces/use-fetch-workspace-authority) — your resolved authority (`{ reasons, capabilities, permissions, rank }`)
* [`useLeaveWorkspace`](https://docs.sublay.io/v8/hooks/workspaces/use-leave-workspace) — leave this workspace
* [Fetch My Membership API](https://docs.sublay.io/v8/api-reference/workspaces/members/fetch-my-membership.md)


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