> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Export data from a workbook

POST https://api.sigmacomputing.com/v2/workbooks/{workbookId}/export
Content-Type: application/json

This endpoint lets you create a file containing data exported from a workbook, allowing you to retrieve large sets of data in a structured format. Export the entire workbook, a single workbook page, or an individual element. You can specify parameters to filter the data and format options for the file.

Different file formats, including CSV, PDF, JSON, and others,  are supported for different export choices. See [Send or schedule workbook exports](/docs/send-or-schedule-workbook-exports) for details on supported formats for different types of exports.

Successful requests to the endpoint return a queryId. Use the **queryId** with the [/v2/query/{queryId}/download](https://help.sigmacomputing.com/reference/download-query) endpoint to download the requested file when it is ready. See [Download an exported file](https://help.sigmacomputing.com/reference/download-query).

## Usage notes
- Retrieve the **workbookId** by calling the [/v2/workbooks](https://help.sigmacomputing.com/reference/list-workbooks) endpoint.
- This endpoint is rate limited to 400 requests per minute.
- This endpoint exports up to 1 million rows for CSV/XLSX/JSON file formats. You can export more rows if you batch your requests in chunks of up to 1 million rows. Use the `rowLimit` parameter to specify the size of the chunk and the `offset` parameter to specify the row to start the next chunk from. For example, if you specify a rowLimit of 2500, to export the next chunk of 2500 rows, specify an offset of 2501. The order of the data matches the order in the data element when the request is made, so there is a possibility of data overlap between requests.
- For security and privacy reasons, the `queryId` used to download the exported data expires 1 hour after your request is received and the file becomes available to download. You can extend this default expiration to 6 hours using the `resultsValidityTimeMs` request parameter.
- When exporting a PNG file, the `pixelWidth` and `pixelHeight` parameters are respected on a best effort basis and the output might not match the requested dimensions.

## Usage scenarios
- Conditional workbook export: Based on an external set of conditions, export a workbook from Sigma.
- Data analysis: Export specific sets of data for offline analysis, leveraging tools that might not connect directly to a data warehouse.
- Integration: Integrate enriched and analyzed data with other applications, providing the necessary data in a format that these applications can process.

## Best practices
- Clearly specify parameters to retrieve only the necessary data, optimizing performance and reducing network load.

Reference: https://help.sigmacomputing.com/reference/export-workbook

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: sigma-rest-api
  version: 1.0.0
paths:
  /v2/workbooks/{workbookId}/export:
    post:
      operationId: exportWorkbook
      summary: Export data from a workbook
      description: >-
        This endpoint lets you create a file containing data exported from a
        workbook, allowing you to retrieve large sets of data in a structured
        format. Export the entire workbook, a single workbook page, or an
        individual element. You can specify parameters to filter the data and
        format options for the file.


        Different file formats, including CSV, PDF, JSON, and others,  are
        supported for different export choices. See [Send or schedule workbook
        exports](/docs/send-or-schedule-workbook-exports) for details on
        supported formats for different types of exports.


        Successful requests to the endpoint return a queryId. Use the
        **queryId** with the
        [/v2/query/{queryId}/download](https://help.sigmacomputing.com/reference/download-query)
        endpoint to download the requested file when it is ready. See [Download
        an exported
        file](https://help.sigmacomputing.com/reference/download-query).


        ## Usage notes

        - Retrieve the **workbookId** by calling the
        [/v2/workbooks](https://help.sigmacomputing.com/reference/list-workbooks)
        endpoint.

        - This endpoint is rate limited to 400 requests per minute.

        - This endpoint exports up to 1 million rows for CSV/XLSX/JSON file
        formats. You can export more rows if you batch your requests in chunks
        of up to 1 million rows. Use the `rowLimit` parameter to specify the
        size of the chunk and the `offset` parameter to specify the row to start
        the next chunk from. For example, if you specify a rowLimit of 2500, to
        export the next chunk of 2500 rows, specify an offset of 2501. The order
        of the data matches the order in the data element when the request is
        made, so there is a possibility of data overlap between requests.

        - For security and privacy reasons, the `queryId` used to download the
        exported data expires 1 hour after your request is received and the file
        becomes available to download. You can extend this default expiration to
        6 hours using the `resultsValidityTimeMs` request parameter.

        - When exporting a PNG file, the `pixelWidth` and `pixelHeight`
        parameters are respected on a best effort basis and the output might not
        match the requested dimensions.


        ## Usage scenarios

        - Conditional workbook export: Based on an external set of conditions,
        export a workbook from Sigma.

        - Data analysis: Export specific sets of data for offline analysis,
        leveraging tools that might not connect directly to a data warehouse.

        - Integration: Integrate enriched and analyzed data with other
        applications, providing the necessary data in a format that these
        applications can process.


        ## Best practices

        - Clearly specify parameters to retrieve only the necessary data,
        optimizing performance and reducing network load.
      tags:
        - Workbooks
      parameters:
        - name: workbookId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: OAuth authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workbooks_exportWorkbook_Response_200'
      requestBody:
        description: The request body.
        content:
          application/json:
            schema:
              type: object
              properties:
                elementId:
                  type: string
                format:
                  $ref: >-
                    #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat
                pageId:
                  type: string
                  description: Identifier of the workbook page.
                parameters:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    Specify the control ID and control value of one or more
                    control elements in the workbook or report to filter the
                    returned data. The control must exist in the Sigma workbook
                    or report and target an element before you can export based
                    on the control value.


                    **Syntax**

                    { control-id: control-value }


                    The control-id is configured in the Sigma workbook or
                    report. The control-value is the value that is passed to the
                    control.


                    Values can take multiple forms, depending on the data type
                    of the control:


                    **Boolean**


                    - Single value: "true" | "false" | ":null"

                    - List of Boolean: "true,false,:null" (No space after the
                    comma.)


                    **Number**


                    - Single value: "10.54", ":null"

                    - List of values: "10.54,23.45,:null" (No space after the
                    comma.)

                    - Range of numbers: "min:10.54,max:23.45" (No space after
                    the comma or colon.)


                    **Text**


                    - Single value: "some-text" | ":null" | ":empty"

                    - List of values: "some-text,more-text,:null,:empty" (No
                    space after the comma.)


                    **Date**


                    All dates use UTC time zones.


                    - Fixed date using ISO-6801 format: "2022-01-01T01:01:59" |
                    ":null"
                        - Formats supported (where: %Y: year, %m: month, %d: day, %H:hours, %M: minutes, %S: seconds):
                            - %Y-%m-%d
                            - %Y-%m-%dT%H:%M
                            - %Y-%m-%dT%H:%M:%S
                    - List of fixed dates:
                    "2022-01-01T01:01:59,2022-02-02T02:02:59,:null"

                    - Relative date: "prior-day-3" | "next-day-3"
                        - Format: [prior|next]-[year|quarter|month|week|isoWeek|day|hour|minute]-[number]
                    - Date range: "min:2022-01-01T01:01:59,max:next-day-3" (No
                    spaces after the comma or colon.)
                        - Leave max blank for "on or after" and min blank for "on or before", for example:
                            - "Date-Range": "min:2020-04-01,max:"
                            - "Date-Range": "min:,max:next-day-3"

                    **Notes**


                    - ":null" is a special value that denotes the null primitive
                    value.

                    - ":empty" is a special value that denotes the empty string
                    "".


                    Use [URL
                    encoding](https://help.sigmacomputing.com/docs/special-characters-for-url-parameters)
                    to encode characters in your control values (such as commas)
                    to prevent the system from interpreting them as separators.


                    For example:

                    "New York, NY,Boston, MA" can be encoded as:


                    "New%20York%2C%20NY,Boston%2C%20MA"
                timeout:
                  type: number
                  format: double
                tag:
                  type: string
                  description: Specifies the version tag of the workbook to be exported.
                exportAs:
                  type: string
                  description: >-
                    Specifies the user ID of the Sigma user to run the export
                    queries as, such as to enforce row-level security. Not
                    supported for users who access Sigma with OAuth.
                rowLimit:
                  type: number
                  format: double
                  description: >-
                    Total number of rows to limit a CSV/XLSX/JSON-formatted
                    export to. 
                offset:
                  type: number
                  format: double
                  description: >-
                    The offset number of rows for a CSV/XLSX/JSON-formatted
                    export to start from. 
servers:
  - url: https://api.sigmacomputing.com
    description: Server for GCP (US) hosted organizations
  - url: https://api.sa.gcp.sigmacomputing.com
    description: Server for GCP (KSA) hosted organizations
  - url: https://aws-api.sigmacomputing.com
    description: Server for AWS US (West) hosted organizations
  - url: https://api.us-a.aws.sigmacomputing.com
    description: Server for AWS US (East) hosted organizations
  - url: https://api.ca.aws.sigmacomputing.com
    description: Server for AWS Canada hosted organizations
  - url: https://api.eu.aws.sigmacomputing.com
    description: Server for AWS Europe hosted organizations
  - url: https://api.au.aws.sigmacomputing.com
    description: Server for AWS Australia and APAC hosted organizations
  - url: https://api.uk.aws.sigmacomputing.com
    description: Server for AWS UK hosted organizations
  - url: https://api.us.azure.sigmacomputing.com
    description: Server for Azure US hosted organizations
  - url: https://api.eu.azure.sigmacomputing.com
    description: Server for Azure Europe hosted organizations
  - url: https://api.ca.azure.sigmacomputing.com
    description: Server for Azure Canada hosted organizations
  - url: https://api.uk.azure.sigmacomputing.com
    description: Server for Azure United Kingdom hosted organizations
  - url: https://api.au.azure.sigmacomputing.com
    description: Server for Azure Australia hosted organizations
components:
  schemas:
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf0Type:
      type: string
      enum:
        - csv
        - jsonl
        - json
        - xlsx
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf0Type
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat0:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf0Type
      required:
        - type
      description: Export options for csv, json, jsonl, xlsx
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat0
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf1Type:
      type: string
      enum:
        - pdf
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf1Type
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf1Layout:
      type: string
      enum:
        - portrait
        - landscape
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf1Layout
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat1:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf1Type
        layout:
          $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf1Layout
      required:
        - type
        - layout
      description: Export options for PDF
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat1
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf2Type:
      type: string
      enum:
        - png
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf2Type
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat2:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormatOneOf2Type
        pixelWidth:
          type: number
          format: double
        pixelHeight:
          type: number
          format: double
      required:
        - type
      description: Export options for PNG
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat2
    V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat:
      oneOf:
        - $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat0
        - $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat1
        - $ref: >-
            #/components/schemas/V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat2
      title: >-
        V2WorkbooksWorkbookIdExportPostRequestBodyContentApplicationJsonSchemaFormat
    workbooks_exportWorkbook_Response_200:
      type: object
      properties:
        jobComplete:
          type: boolean
        queryId:
          type: string
        rows:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
        message:
          type: string
      required:
        - jobComplete
        - queryId
      title: workbooks_exportWorkbook_Response_200
  securitySchemes:
    OAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 authentication

```

## Examples

### Export Success



**Request**

```json
undefined
```

**Response**

```json
{
  "jobComplete": false,
  "queryId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
  "rows": [
    "[Array]"
  ]
}
```

**SDK Code**

```python Export Success
import requests

url = "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Export Success
const url = 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Export Success
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Export Success
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Export Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .asString();
```

```php Export Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export', [
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Export Success
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/workbooks/workbookId/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Export Success
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/workbooks/workbookId/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Export Failure



**Request**

```json
undefined
```

**Response**

```json
{
  "jobComplete": false,
  "queryId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
  "message": "Export finished at 1600000000000"
}
```

**SDK Code**

```python Export Failure
import requests

url = "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Export Failure
const url = 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Export Failure
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Export Failure
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Export Failure
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .asString();
```

```php Export Failure
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export', [
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Export Failure
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/workbooks/workbookId/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Export Failure
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/workbooks/workbookId/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Export Incomplete



**Request**

```json
undefined
```

**Response**

```json
{
  "jobComplete": false,
  "queryId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff"
}
```

**SDK Code**

```python Export Incomplete
import requests

url = "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Export Incomplete
const url = 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Export Incomplete
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Export Incomplete
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Export Incomplete
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .asString();
```

```php Export Incomplete
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export', [
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Export Incomplete
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/workbooks/workbookId/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Export Incomplete
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/workbooks/workbookId/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Request Example



**Request**

```json
{
  "elementId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
  "format": {
    "type": "csv"
  },
  "parameters": {
    "param": "value"
  },
  "timeout": 5,
  "tag": "my-tag",
  "exportAs": "myUserId",
  "rowLimit": 1.1,
  "offset": 1.1,
  "filters": {
    "filter": "value"
  }
}
```

**Response**

```json
{
  "jobComplete": false,
  "queryId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
  "rows": [
    "[Array]"
  ]
}
```

**SDK Code**

```python Request Example
import requests

url = "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

payload = {
    "elementId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
    "format": { "type": "csv" },
    "parameters": { "param": "value" },
    "timeout": 5,
    "tag": "my-tag",
    "exportAs": "myUserId",
    "rowLimit": 1.1,
    "offset": 1.1,
    "filters": { "filter": "value" }
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Request Example
const url = 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"elementId":"88889999-aaaa-bbbb-cccc-ddddeeeeffff","format":{"type":"csv"},"parameters":{"param":"value"},"timeout":5,"tag":"my-tag","exportAs":"myUserId","rowLimit":1.1,"offset":1.1,"filters":{"filter":"value"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Request Example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/workbooks/workbookId/export"

	payload := strings.NewReader("{\n  \"elementId\": \"88889999-aaaa-bbbb-cccc-ddddeeeeffff\",\n  \"format\": {\n    \"type\": \"csv\"\n  },\n  \"parameters\": {\n    \"param\": \"value\"\n  },\n  \"timeout\": 5,\n  \"tag\": \"my-tag\",\n  \"exportAs\": \"myUserId\",\n  \"rowLimit\": 1.1,\n  \"offset\": 1.1,\n  \"filters\": {\n    \"filter\": \"value\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Request Example
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"elementId\": \"88889999-aaaa-bbbb-cccc-ddddeeeeffff\",\n  \"format\": {\n    \"type\": \"csv\"\n  },\n  \"parameters\": {\n    \"param\": \"value\"\n  },\n  \"timeout\": 5,\n  \"tag\": \"my-tag\",\n  \"exportAs\": \"myUserId\",\n  \"rowLimit\": 1.1,\n  \"offset\": 1.1,\n  \"filters\": {\n    \"filter\": \"value\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Request Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/workbooks/workbookId/export")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"elementId\": \"88889999-aaaa-bbbb-cccc-ddddeeeeffff\",\n  \"format\": {\n    \"type\": \"csv\"\n  },\n  \"parameters\": {\n    \"param\": \"value\"\n  },\n  \"timeout\": 5,\n  \"tag\": \"my-tag\",\n  \"exportAs\": \"myUserId\",\n  \"rowLimit\": 1.1,\n  \"offset\": 1.1,\n  \"filters\": {\n    \"filter\": \"value\"\n  }\n}")
  .asString();
```

```php Request Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/workbooks/workbookId/export', [
  'body' => '{
  "elementId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
  "format": {
    "type": "csv"
  },
  "parameters": {
    "param": "value"
  },
  "timeout": 5,
  "tag": "my-tag",
  "exportAs": "myUserId",
  "rowLimit": 1.1,
  "offset": 1.1,
  "filters": {
    "filter": "value"
  }
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Request Example
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/workbooks/workbookId/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"elementId\": \"88889999-aaaa-bbbb-cccc-ddddeeeeffff\",\n  \"format\": {\n    \"type\": \"csv\"\n  },\n  \"parameters\": {\n    \"param\": \"value\"\n  },\n  \"timeout\": 5,\n  \"tag\": \"my-tag\",\n  \"exportAs\": \"myUserId\",\n  \"rowLimit\": 1.1,\n  \"offset\": 1.1,\n  \"filters\": {\n    \"filter\": \"value\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Example
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "elementId": "88889999-aaaa-bbbb-cccc-ddddeeeeffff",
  "format": ["type": "csv"],
  "parameters": ["param": "value"],
  "timeout": 5,
  "tag": "my-tag",
  "exportAs": "myUserId",
  "rowLimit": 1.1,
  "offset": 1.1,
  "filters": ["filter": "value"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/workbooks/workbookId/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```