---
agentTools:
  projectIndex: https://seafile-api.readme.io/llms.txt
---

# Batch add invitations

The current user can batch invite users by using multiple email. Return the successful invitation message and the reason for the failure.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Account Operations - User",
    "description": "The official SeaTable API Reference (OpenAPI 3.0). - Part 'User Account Operations'.",
    "version": "13.0"
  },
  "servers": [
    {
      "url": "https://{server}",
      "variables": {
        "server": {
          "default": "cloud.seafile.com"
        }
      }
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "metrics-enabled": false,
    "proxy-enabled": false
  },
  "components": {
    "securitySchemes": {
      "AccountTokenAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "This is the [Account-Token](/reference/authentication)."
      }
    },
    "schemas": {
      "type": {
        "type": "string",
        "description": "User type",
        "example": "guest"
      },
      "batch_accepter": {
        "type": "string",
        "description": "You can add multiple accepter",
        "example": "example@example.com"
      }
    }
  },
  "paths": {
    "/api/v2.1/invitations/batch/": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Batch add invitations",
        "description": "The current user can batch invite users by using multiple email. Return the successful invitation message and the reason for the failure.",
        "security": [
          {
            "AccountTokenAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "$ref": "#/components/schemas/type"
                  },
                  "accepter": {
                    "$ref": "#/components/schemas/batch_accepter"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Error message",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "error_msg": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "success": {
                      "type": "object",
                      "description": "Invitation info",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "token": {
                          "type": "string"
                        },
                        "inviter": {
                          "type": "string"
                        },
                        "accepter": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "invite_time": {
                          "type": "string"
                        },
                        "accept_time": {
                          "type": "string"
                        },
                        "expire_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "example": {
                    "failed": [
                      {
                        "email": "Seahub@example.com",
                        "error_msg": "Seahub@example.com is already invited."
                      }
                    ],
                    "success": [
                      {
                        "id": 34,
                        "token": "475a288e2fa64607bb81937c624ab756",
                        "inviter": "9b4393c623c74243b0ad43709701687d@auth.local",
                        "accepter": "Seafile@example.com",
                        "type": "guest",
                        "invite_time": "2024-03-14T13:53:44+08:00",
                        "accept_time": "",
                        "expire_time": "2024-03-17T13:53:44+08:00"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 183,
      "2": 248,
      "3": 230,
      "4": 103,
      "5": 20,
      "6": 160,
      "7": 0,
      "8": 41,
      "9": 50,
      "10": 176,
      "11": 71
    }
  }
}
```