Share feedback
Answers are generated based on the documentation.

Update org member (role)

PUT/v2/orgs/{org_name}/members/{username}

Updates the role of a member in the organization. Only users in the "owners" group of the organization can use this endpoint.

This operation accepts bearer tokens issued from organization access tokens (OATs). The token must have the required resource access and scopes.

Connection and access

API connection and authentication guidance

https://hub.docker.com — Docker HUB API

Use one of these alternatives. Requirements within an alternative apply together.

  • bearerAuth

Parameters

org_name path Required

Name of the organization (namespace).

Type: string

All schema constraints and annotations
{
  "type": "string"
}

username path Required

Username, identifier for the user (namespace, DockerID).

Type: string

All schema constraints and annotations
{
  "example": "jonsnow",
  "type": "string"
}

Request and responses

Request

application/json

role · required

Type: string

Role of the member. Valid values are the core roles owner, editor, and member, or the name of an existing custom role. Use the custom role's name identifier, not its label or UUID.
All schema constraints and annotations
{
  "description": "Role of the member. Valid values are the core roles\n`owner`, `editor`, and `member`, or the name of an\nexisting [custom role](https://docs.docker.com/security/roles-and-permissions/custom-roles/manage/).\nUse the custom role's name identifier, not its label or UUID.\n",
  "example": "owner",
  "type": "string"
}
All schema constraints and annotations
{
  "examples": [
    {
      "role": "owner"
    }
  ],
  "properties": {
    "role": {
      "description": "Role of the member. Valid values are the core roles\n`owner`, `editor`, and `member`, or the name of an\nexisting [custom role](https://docs.docker.com/security/roles-and-permissions/custom-roles/manage/).\nUse the custom role's name identifier, not its label or UUID.\n",
      "example": "owner",
      "type": "string"
    }
  },
  "required": [
    "role"
  ]
}

Schema example

{
  "role": "owner"
}

Response 200

Member role updated

application/json

Schema: org_member

Schema example

{
  "date_joined": "2021-01-05T21:06:53.506400Z",
  "email": "example@docker.com",
  "full_name": "Jon Snow",
  "groups": [
    "owners"
  ],
  "id": "0ab70deb065a43fcacd55d48caa945d8",
  "is_guest": false,
  "role": "Owner",
  "type": "User",
  "username": "dockeruser"
}

Response 400

Bad Request

application/json

Schema: error

error

{
  "errinfo": null,
  "message": "bad request"
}

Response 401

Unauthorized

application/json

Schema: error

error

{
  "errinfo": null,
  "message": "unauthorized"
}

Response 403

Forbidden

application/json

Schema: error

error

{
  "errinfo": null,
  "message": "permission denied"
}

Response 404

Not Found

application/json

Schema: error

error

{
  "errinfo": null,
  "message": "not found"
}

Referenced schemas

#/components/schemas/org_member

Complete operation contract
{
  "description": "Updates the role of a member in the organization.\n***Only users in the \"owners\" group of the organization can use this endpoint.***\n\nThis operation accepts bearer tokens issued from organization access tokens (OATs). The token must have the required resource access and scopes.\n",
  "operationId": "putV2OrgsByOrgNameMembersByUsername",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "examples": [
            {
              "role": "owner"
            }
          ],
          "properties": {
            "role": {
              "description": "Role of the member. Valid values are the core roles\n`owner`, `editor`, and `member`, or the name of an\nexisting [custom role](https://docs.docker.com/security/roles-and-permissions/custom-roles/manage/).\nUse the custom role's name identifier, not its label or UUID.\n",
              "example": "owner",
              "type": "string"
            }
          },
          "required": [
            "role"
          ]
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/org_member"
          }
        }
      },
      "description": "Member role updated"
    },
    "400": {
      "$ref": "#/components/responses/bad_request"
    },
    "401": {
      "$ref": "#/components/responses/unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/forbidden"
    },
    "404": {
      "$ref": "#/components/responses/not_found"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "Update org member (role)",
  "tags": [
    "orgs"
  ]
}