This section provides an overview of the workbook operations available through the Tableau API. Workbook operations include creating, updating, and managing workbooks within a Tableau Server or Tableau Online environment.

Workbook Creation

To create a new workbook, you can use the /workbooks endpoint. This endpoint allows you to specify the workbook's metadata, data source connections, and initial sheets.

  • Endpoint: /api/v1/workbooks
  • Method: POST
  • Example:
    {
      "name": "New Workbook",
      "description": "A new workbook created via the API",
      "dataSources": [
        {
          "type": "tableauDataSource",
          "name": "MyDataSource",
          "connection": {
            "type": "tableauServer",
            "serverName": "myserver.com",
            "dataSourceName": "mydatabase"
          }
        }
      ]
    }
    

Workbook Update

You can update an existing workbook using the /workbooks/{workbookId} endpoint. This endpoint allows you to modify workbook properties, sheets, and data source connections.

  • Endpoint: /api/v1/workbooks/{workbookId}
  • Method: PUT
  • Example:
    {
      "name": "Updated Workbook",
      "description": "The workbook has been updated via the API"
    }
    

Workbook Deletion

To delete a workbook, you can use the /workbooks/{workbookId} endpoint with a DELETE request.

  • Endpoint: /api/v1/workbooks/{workbookId}
  • Method: DELETE

Sheet Management

Sheet operations include creating, updating, and deleting sheets within a workbook.

  • Create Sheet: /api/v1/workbooks/{workbookId}/sheets
  • Update Sheet: /api/v1/workbooks/{workbookId}/sheets/{sheetId}
  • Delete Sheet: /api/v1/workbooks/{workbookId}/sheets/{sheetId}

Data Source Management

Data source operations include creating, updating, and deleting data source connections within a workbook.

  • Create Data Source: /api/v1/workbooks/{workbookId}/dataSources
  • Update Data Source: /api/v1/workbooks/{workbookId}/dataSources/{dataSourceId}
  • Delete Data Source: /api/v1/workbooks/{workbookId}/dataSources/{dataSourceId}

For more detailed information on these operations, please refer to the Tableau API Reference.

Tableau Workbook Example