# Bulk create invites


[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/invites/bulk`

Create multiple invites by emails or DockerIDs. Only a team owner can create invites.

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 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "dry_run": true,
  "invitees": [
    "invitee1DockerId",
    "invitee2@docker.com",
    "invitee3@docker.com"
  ],
  "org": "docker",
  "role": "member",
  "team": "owners"
}' \
  'https://hub.docker.com/v2/invites/bulk'
```

## Parameters

### X-Analytics-Client-Feature

Location: header. Required: no.

Optional string that indicates the feature used to submit the bulk invites (e.g.'file', 'web')

```json
{
  "description": "Optional string that indicates the feature used to submit the bulk invites (e.g.'file', 'web')",
  "in": "header",
  "name": "X-Analytics-Client-Feature",
  "pointer": "/paths/~1v2~1invites~1bulk/parameters/0",
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Request  application/json




Schema:

```json
{
  "examples": [
    {
      "dry_run": true,
      "invitees": [
        "invitee1DockerId",
        "invitee2@docker.com",
        "invitee3@docker.com"
      ],
      "org": "docker",
      "role": "member",
      "team": "owners"
    }
  ],
  "properties": {
    "dry_run": {
      "description": "Optional, run through validation but don't actually change data.",
      "example": true,
      "type": "boolean"
    },
    "invitees": {
      "description": "list of invitees emails or Docker Ids",
      "example": [
        "invitee1DockerId",
        "invitee2@docker.com",
        "invitee3@docker.com"
      ],
      "items": {
        "description": "invitee email or Docker ID",
        "type": "string"
      },
      "type": "array"
    },
    "org": {
      "description": "organization name",
      "example": "docker",
      "type": "string"
    },
    "role": {
      "description": "role for invitees",
      "example": "member",
      "type": "string"
    },
    "team": {
      "description": "team name",
      "example": "owners",
      "type": "string"
    }
  },
  "required": [
    "org",
    "invitees"
  ],
  "type": "object"
}
```




Schema example:
```json
{
  "dry_run": true,
  "invitees": [
    "invitee1DockerId",
    "invitee2@docker.com",
    "invitee3@docker.com"
  ],
  "org": "docker",
  "role": "member",
  "team": "owners"
}
```


### Response 202 application/json

Accepted


Schema:

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




Schema example:
```json
{
  "invitees": [
    {
      "invite": {
        "created_at": "2021-10-28T18:30:19.520861Z",
        "id": "e36eca69-4cc8-4f17-9845-ae8c2b832691",
        "invitee": "invitee@docker.com",
        "inviter_username": "moby",
        "org": "docker",
        "team": "owners"
      },
      "invitee": "invitee@docker.com",
      "status": "invited"
    },
    {
      "invitee": "invitee2@docker.com",
      "status": "existing_org_member"
    },
    {
      "invitee": "invitee3@docker.com",
      "status": "invalid_email_or_docker_id"
    }
  ]
}
```


### Response 400 application/json

Bad Request


Schema:

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




error:
```json
{
  "errinfo": null,
  "message": "bad request"
}
```


### Response 409 application/json

Conflict


Schema:

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




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


## Complete operation contract

```json
{
  "description": "Create multiple invites by emails or DockerIDs. Only a team owner can create invites.\n\nThis operation accepts bearer tokens issued from organization access tokens (OATs). The token must have the required resource access and scopes.\n",
  "operationId": "postV2InvitesBulk",
  "requestBody": {
    "$ref": "#/components/requestBodies/bulk_invite_request"
  },
  "responses": {
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/bulk_invite"
          }
        }
      },
      "description": "Accepted"
    },
    "400": {
      "$ref": "#/components/responses/bad_request"
    },
    "409": {
      "$ref": "#/components/responses/conflict"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "Bulk create invites",
  "tags": [
    "invites"
  ]
}
```

## Referenced schemas

- `#/components/requestBodies/bulk_invite_request`

- `#/components/responses/bad_request`

- `#/components/responses/conflict`

- [#/components/schemas/bulk_invite](/reference/api/hub/latest/schemas/bulk_invite/)




