# Roles endpoints

Every path starts at your [API URL](https://docs.qualithm.com/api.md#find-your-api-url). Every response is JSON, and an error has the [error body](https://docs.qualithm.com/api.md#errors).

## List the teams the caller belongs to and their role in each; a token sees only its own

`GET /v1/account/memberships`

Newest team first, by the team's `createdAt` then the membership `id`.

Needs an [API token](https://docs.qualithm.com/api.md#authenticate).

**Parameters**

| Name | In | Type | Required | Description |
| ---- | -- | ---- | -------- | ----------- |
| `limit` | query | integer | No | Items per page, 1 to 100. Default 50. |
| `cursor` | query | string | No | A previous page's `nextCursor`, to read the page after it |

**Response:** `200` with [RoleAssignmentPage](#roleassignmentpage) in `data`.

**[Errors](https://docs.qualithm.com/api.md#errors):** `400`, `401`, `429`, `500`, `503`

```bash
curl "<your-api-url>/v1/account/memberships" \
  -H "Authorization: Bearer <your-api-token>"
```

## Types

### RoleAssignmentPage

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `items` | array of [RoleAssignment](#roleassignment) | Yes |  |
| `nextCursor` | string or null | Yes | Pass as `cursor` to read the next page; `null` on the last page |

### RoleAssignment

One team the caller is an active member of, and their role in it.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `id` | string | Yes | A member ID: `mbr_…`; also accepts the legacy `mem_…` |
| `accountId` | string | Yes | An account ID: `acc_…` |
| `teamId` | string | Yes | A team ID: `tem_…`; also accepts the legacy `tm_…` |
| `teamName` | string | Yes |  |
| `role` | [MemberRole](#memberrole) | Yes |  |
| `createdAt` | string (date-time) | Yes | UTC time, RFC 3339 |
| `updatedAt` | string (date-time) | Yes | UTC time, RFC 3339 |

### MemberRole

A member's role in a team.

one of `"owner"`, `"manager"`, `"viewer"`.
