# Add a member to a group


[API catalog](/reference/api/) · [Docker Hub overview](/reference/api/hub/latest/) · [Product manual](https://docs.docker.com/docker-hub/) · [OpenAPI specification](/reference/api/hub/latest.yaml)

API version: 2-beta



`POST /v2/orgs/{org_name}/groups/{group_name}/members`

Add a member to a group.

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](/reference/api/hub/latest/#authentication)


Server: `https://hub.docker.com`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "bearerAuth": []
  }
]
```
## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request POST \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "member": "jonsnow"
}' \
  'https://hub.docker.com/v2/orgs/myorganization/groups/developers/members'
```

## Parameters

### org_name

Location: path. Required: yes.

Name of the organization (namespace).

```json
{
  "description": "Name of the organization (namespace).",
  "example": "myorganization",
  "in": "path",
  "name": "org_name",
  "pointer": "/paths/~1v2~1orgs~1{org_name}~1groups~1{group_name}~1members/post/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### group_name

Location: path. Required: yes.

Name of the group (team) in the organization.

```json
{
  "description": "Name of the group (team) in the organization.",
  "in": "path",
  "name": "group_name",
  "pointer": "/paths/~1v2~1orgs~1{org_name}~1groups~1{group_name}~1members/post/parameters/1",
  "required": true,
  "schema": {
    "example": "developers",
    "type": "string"
  }
}
```

## Request and responses

### Request  application/json




Schema:

```json
{
  "examples": [
    {
      "member": "jonsnow"
    }
  ],
  "properties": {
    "member": {
      "example": "jonsnow",
      "type": "string"
    }
  },
  "required": [
    "member"
  ],
  "type": "object"
}
```




Schema example:
```json
{
  "member": "jonsnow"
}
```


### Response 200 

OK

No response content is declared.






### Response 401 application/json

Unauthorized


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "unauthorized"
}
```


### Response 403 application/json

Forbidden


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "permission denied"
}
```


### Response 404 application/json

Not Found


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "not found"
}
```


### Response 500 application/json

Internal


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "internal error"
}
```


## Complete operation contract

```json
{
  "description": "Add a member to a group.\n\nThis operation accepts bearer tokens issued from organization access tokens (OATs). The token must have the required resource access and scopes.\n",
  "operationId": "postV2OrgsByOrgNameGroupsByGroupNameMembers",
  "parameters": [
    {
      "$ref": "#/components/parameters/org_name"
    },
    {
      "$ref": "#/components/parameters/group_name"
    }
  ],
  "requestBody": {
    "$ref": "#/components/requestBodies/add_member_to_org_group"
  },
  "responses": {
    "200": {
      "description": "OK"
    },
    "401": {
      "$ref": "#/components/responses/unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/forbidden"
    },
    "404": {
      "$ref": "#/components/responses/not_found"
    },
    "500": {
      "$ref": "#/components/responses/internal_error"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "Add a member to a group",
  "tags": [
    "groups"
  ]
}
```

## Referenced schemas

- `#/components/parameters/group_name`

- `#/components/parameters/org_name`

- `#/components/requestBodies/add_member_to_org_group`

- `#/components/responses/forbidden`

- `#/components/responses/internal_error`

- `#/components/responses/not_found`

- `#/components/responses/unauthorized`




