# Create View External Link

Create a view external link from a view and optionally custom the link's token, password, permission and expiration days.

# 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 Links",
      "description": "Manage sharing links"
    }
  ],
  "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": {
      "user_account_password": {
        "type": "string",
        "example": "654321"
      },
      "table_id": {
        "type": "string",
        "example": "0000"
      },
      "view_id": {
        "type": "string",
        "example": "0000"
      },
      "expire_days": {
        "type": "integer",
        "description": "Add expiration period in days. Optional.",
        "example": 30
      },
      "token": {
        "type": "string",
        "description": "An optional custom token of the generated link. For example, it'll appear as \"https<span>://cloud.seatable.io/dtable/view-external-links/custom/example/\". If not given, SeaTable will give a random token to the link.",
        "example": "my-custom-link"
      }
    }
  },
  "paths": {
    "/api/v2.1/workspace/{workspace_id}/dtable/{base_name}/view-external-links/": {
      "post": {
        "tags": [
          "Sharing Links"
        ],
        "summary": "Create View External Link",
        "operationId": "createViewExternalLink",
        "description": "Create a view external link from a view and optionally custom the link's token, password, permission and expiration days.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "table_id": {
                    "$ref": "#/components/schemas/table_id"
                  },
                  "view_id": {
                    "$ref": "#/components/schemas/view_id"
                  },
                  "token": {
                    "$ref": "#/components/schemas/token"
                  },
                  "password": {
                    "$ref": "#/components/schemas/user_account_password"
                  },
                  "expire_days": {
                    "$ref": "#/components/schemas/expire_days"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "AccountTokenAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/workspace_id"
          },
          {
            "$ref": "#/components/parameters/base_name"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "from_dtable": {
                      "type": "string"
                    },
                    "creator": {
                      "type": "string"
                    },
                    "creator_name": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    },
                    "permission": {
                      "type": "string"
                    },
                    "create_at": {
                      "type": "string"
                    },
                    "view_cnt": {
                      "type": "integer"
                    },
                    "table_id": {
                      "type": "string"
                    },
                    "view_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "is_custom": {
                      "type": "boolean"
                    },
                    "expire_date": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 14,
                  "from_dtable": "Example",
                  "creator": "123456786569491ba42905bf1647fd3f@auth.local",
                  "creator_name": "Jasmin Tee",
                  "token": "123456788ce44028978a",
                  "permission": "r",
                  "create_at": "2021-05-18T14:26:07+00:00",
                  "view_cnt": 0,
                  "table_id": "0000",
                  "view_id": "NdFD",
                  "url": "https://cloud.seatable.io/dtable/view-external-links/123456788ce44028978a/",
                  "is_custom": false,
                  "expire_date": ""
                }
              }
            }
          }
        }
      }
    }
  },
  "_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
    }
  }
}
```