# Create User Share

Share a base to a certain user with certain permission.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Account Operations - User",
    "description": "The official SeaTable API Reference (OpenAPI 3.0).",
    "version": "6.2"
  },
  "servers": [
    {
      "url": "https://{server}",
      "variables": {
        "server": {
          "default": "cloud.seatable.io"
        }
      }
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "metrics-enabled": false,
    "proxy-enabled": false
  },
  "tags": [
    {
      "name": "Sharing",
      "description": "Manage shares"
    }
  ],
  "components": {
    "securitySchemes": {
      "AccountTokenAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "This is the [Account-Token](/reference/authentication)."
      }
    },
    "parameters": {
      "workspace_id": {
        "name": "workspace_id",
        "description": "id of your workspace.",
        "in": "path",
        "schema": {
          "type": "integer",
          "minimum": 1
        },
        "required": true,
        "example": 127
      },
      "base_name": {
        "name": "base_name",
        "description": "name of your base.",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true,
        "example": "My Projects"
      }
    },
    "schemas": {
      "permission": {
        "type": "string",
        "description": "`r` for read only or `rw` for read and write",
        "example": "rw"
      },
      "user_account_email": {
        "type": "string",
        "description": "The user ID ending with @auth.local",
        "example": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6@auth.local"
      }
    }
  },
  "paths": {
    "/api/v2.1/workspace/{workspace_id}/dtable/{base_name}/share/": {
      "post": {
        "tags": [
          "Sharing"
        ],
        "summary": "Create User Share",
        "operationId": "createUserShare",
        "description": "Share a base to a certain user with certain permission.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "permission": {
                    "$ref": "#/components/schemas/permission"
                  },
                  "email": {
                    "$ref": "#/components/schemas/user_account_email"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "AccountTokenAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/workspace_id"
          },
          {
            "$ref": "#/components/parameters/base_name"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "success": true
                }
              }
            }
          }
        }
      }
    }
  },
  "_id": {
    "buffer": {
      "0": 105,
      "1": 212,
      "2": 220,
      "3": 12,
      "4": 20,
      "5": 34,
      "6": 131,
      "7": 31,
      "8": 141,
      "9": 111,
      "10": 187,
      "11": 147
    }
  }
}
```