Skip to main content
PATCH/members/{userId}

Update Member Role

Changes the project role of an existing project member.

Does not affect the user's org-level membership or memberships on other projects.

Requires PROJECT_ADMIN on the project or ORG_ADMIN.

Parameters
userId *path

The member's user id (usr_...).

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Request body
role *"PROJECT_ADMIN" | "PROJECT_EDITOR" | "PROJECT_MEMBER" | "PROJECT_VIEWER" | "PROJECT_AUDITOR" | "PROJECT_AUTHOR" | "PROJECT_ANALYST"

The member's new project role: PROJECT_ADMIN, PROJECT_EDITOR, PROJECT_MEMBER, PROJECT_VIEWER, PROJECT_AUDITOR, PROJECT_AUTHOR or PROJECT_ANALYST.

Responses
HTTPK9O CodeDescription
200Success
401K9O_SESSION_EXPIREDYour session has expired; sign in again to continue.
403K9O_ACCESS_DENIEDYou do not have the required role (PROJECT_ADMIN or higher) to change a member's role.
404K9O_END_USER_NOT_FOUNDNo member with the specified user ID was found on this project.
410K9O_SLUG_GONEThe project slug in the URL has been renamed; update your integration to use the new slug.
Response body (200)
data *object

A project member.

userId *string

The member's user id (usr_...).

projectId *string

The project's id (proj_...).

role *"PROJECT_ADMIN" | "PROJECT_EDITOR" | "PROJECT_MEMBER" | "PROJECT_VIEWER" | "PROJECT_AUDITOR" | "PROJECT_AUTHOR" | "PROJECT_ANALYST"

The member's explicit project role.

Org owners and admins also have admin access to every project without a row here, and are listed only if they have one.

email *string

The member's sign-in email address.

displayName *string

The member's display name.

invitedAt *string <date-time>

When the membership was created.

acceptedAt *any

When the membership was accepted, or null while it is still an invitation.

One of: string <date-time>
or: null
state *"invited" | "active"

invited while acceptedAt is null, otherwise active.

meta *any

Request metadata: cost, timing and the request and trace ids.

cURL
curl -X PATCH 'https://<org>.api-<region>.k9o.io/@storefront/members/<userId>' \
  -H 'Authorization: Bearer $K9O_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "role": "PROJECT_ADMIN"
}'

Showing example in cURL

Request example
{
  "role": "PROJECT_ADMIN"
}
Response example (200)
{
  "data": {
    "userId": "string",
    "projectId": "string",
    "role": "PROJECT_ADMIN",
    "email": "string",
    "displayName": "string",
    "invitedAt": "string",
    "acceptedAt": "string",
    "state": "invited"
  }
}

More in Members & End Users