Memberships

List organization memberships

Retrieve a list of all organizations the user is a member of

GET/me/memberships
Authorization
Query parameters
Response

OK

Body
nextPageTokenstring

The token to fetch the next page of results. If empty, there are no more results to fetch.

results*array of OrganizationMembership
Request
const response = await fetch('/me/memberships', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "nextPageToken": "text",
  "results": [
    {
      "organization": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "slug": "text",
        "avatarUrl": "text",
        "status": "active",
        "statusReason": "text",
        "pendingMemberCount": 0,
        "activeMemberCount": 0,
        "owner": "123e4567-e89b-12d3-a456-426614174000",
        "createdAt": "2024-12-21T12:30:38.037Z",
        "updatedAt": "2024-12-21T12:30:38.037Z",
        "managedBy": [
          {
            "Type": "text",
            "ID": "text"
          }
        ]
      },
      "status": "banned",
      "createdAt": "2024-12-21T12:30:38.037Z",
      "updatedAt": "2024-12-21T12:30:38.037Z",
      "roleRefs": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "type": "organization",
          "workspaces": [
            "123e4567-e89b-12d3-a456-426614174000"
          ]
        }
      ],
      "requiredSsoAuth": false,
      "requiredMfaAuth": false
    }
  ]
}

Get organization membership

Retrieve a single organization membership object.

GET/me/memberships/{organizationId}
Authorization
Path parameters
organizationId*string

The organization ID

Response

OK

Body
organization*Organization

The organization record

status*MembershipStatus (enum)

The status of user's membership on the organization.

bannedinvitedactive
createdAt*string (date-time)

When the membership was created.

updatedAt*string (date-time)

When the membership was last updated.

roleRefs*array of RoleReference

THe list of roles to assign to the membership

requiredSsoAuthboolean

Indicates if SSO Authentication is required for this membership

requiredMfaAuthboolean

Indicates if MFA Authentication is required for this membership

Request
const response = await fetch('/me/memberships/{organizationId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "organization": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "slug": "text",
    "avatarUrl": "text",
    "status": "active",
    "statusReason": "text",
    "pendingMemberCount": 0,
    "activeMemberCount": 0,
    "owner": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2024-12-21T12:30:38.037Z",
    "updatedAt": "2024-12-21T12:30:38.037Z",
    "managedBy": [
      {
        "Type": "text",
        "ID": "text"
      }
    ]
  },
  "status": "banned",
  "createdAt": "2024-12-21T12:30:38.037Z",
  "updatedAt": "2024-12-21T12:30:38.037Z",
  "roleRefs": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "type": "organization",
      "workspaces": [
        "123e4567-e89b-12d3-a456-426614174000"
      ]
    }
  ],
  "requiredSsoAuth": false,
  "requiredMfaAuth": false
}

Accept organization invitation

Accept a pending invitation to join the organization.

POST/me/memberships/{organizationId}
Authorization
Path parameters
organizationId*string

The organization ID

Response

OK

Body
organization*Organization

The organization record

status*MembershipStatus (enum)

The status of user's membership on the organization.

bannedinvitedactive
createdAt*string (date-time)

When the membership was created.

updatedAt*string (date-time)

When the membership was last updated.

roleRefs*array of RoleReference

THe list of roles to assign to the membership

requiredSsoAuthboolean

Indicates if SSO Authentication is required for this membership

requiredMfaAuthboolean

Indicates if MFA Authentication is required for this membership

Request
const response = await fetch('/me/memberships/{organizationId}', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "organization": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "slug": "text",
    "avatarUrl": "text",
    "status": "active",
    "statusReason": "text",
    "pendingMemberCount": 0,
    "activeMemberCount": 0,
    "owner": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2024-12-21T12:30:38.037Z",
    "updatedAt": "2024-12-21T12:30:38.037Z",
    "managedBy": [
      {
        "Type": "text",
        "ID": "text"
      }
    ]
  },
  "status": "banned",
  "createdAt": "2024-12-21T12:30:38.037Z",
  "updatedAt": "2024-12-21T12:30:38.037Z",
  "roleRefs": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "type": "organization",
      "workspaces": [
        "123e4567-e89b-12d3-a456-426614174000"
      ]
    }
  ],
  "requiredSsoAuth": false,
  "requiredMfaAuth": false
}

Leave organization

Remove the membership from the organization for the current user

DELETE/me/memberships/{organizationId}
Authorization
Path parameters
organizationId*string

The organization ID

Response

OK

Request
const response = await fetch('/me/memberships/{organizationId}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "code": "text",
  "message": "text"
}

Last updated