# Structured Sheets ## List structured sheets `client.StructuredSheets.List(ctx, query) (*CursorIDPage[StructuredSheetResponse], error)` **get** `/v1/structured-sheets` List all structured sheets conversions for the authenticated user. Results are paginated using cursor-based pagination. ### Parameters - `query StructuredSheetListParams` - `After param.Field[string]` A cursor for pagination. Use the `last_id` from a previous response to fetch the next page of results. - `Limit param.Field[int64]` Maximum number of results to return per page. ### Returns - `type StructuredSheetResponse struct{…}` Response representing a structured sheet conversion job. This is returned from POST (create), GET (retrieve), and list endpoints. - `ID string` The unique identifier for this structured sheet conversion. - `CreatedAt Time` The timestamp when the conversion was started. - `FileID string` The unique identifier for the source file. - `Object StructuredSheet` The object type, which is always 'structured_sheet'. - `const StructuredSheetStructuredSheet StructuredSheet = "structured_sheet"` - `Status StructuredSheetResponseStatus` The current processing status. - `const StructuredSheetResponseStatusQueued StructuredSheetResponseStatus = "queued"` - `const StructuredSheetResponseStatusInProgress StructuredSheetResponseStatus = "in_progress"` - `const StructuredSheetResponseStatusCompleted StructuredSheetResponseStatus = "completed"` - `const StructuredSheetResponseStatusFailed StructuredSheetResponseStatus = "failed"` - `const StructuredSheetResponseStatusCancelled StructuredSheetResponseStatus = "cancelled"` - `UpdatedAt Time` The timestamp when the conversion was last updated. - `LastError StructuredSheetResponseLastError` Error information when processing fails. - `Code string` A machine-readable error code. - `Message string` A human-readable description of the error. - `SheetNames []string` List of sheet names included in this conversion. - `TableCount int64` Number of tables extracted from the workbook. Only present when status is 'completed'. ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) page, err := client.StructuredSheets.List(context.TODO(), deeptable.StructuredSheetListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "data": [ { "id": "ss_01kfxgjd94fn9stqm42nejb627", "created_at": "2024-01-15T10:30:00Z", "file_id": "file_01kfxgjd94fn9stqm414vjb0s8", "object": "structured_sheet", "status": "completed", "updated_at": "2024-01-15T10:35:00Z", "last_error": { "code": "invalid_file_format", "message": "The uploaded file is not a valid Excel spreadsheet." }, "sheet_names": [ "Sheet1", "Financials" ], "table_count": 6 } ], "has_more": false, "object": "list", "first_id": "ss_01kfxgjd94fn9stqm42nejb627", "last_id": "ss_01kfxgjd94fn9stqm42nejb627" } ``` ## Create structured sheet `client.StructuredSheets.New(ctx, body) (*StructuredSheetResponse, error)` **post** `/v1/structured-sheets` Start converting a spreadsheet workbook into structured data. This initiates an asynchronous conversion process. Poll the returned resource using the `id` to check completion status. ### Parameters - `body StructuredSheetNewParams` - `FileID param.Field[string]` The unique identifier of the file to convert. - `SheetNames param.Field[[]string]` List of sheet names to convert. If None, all sheets will be converted. ### Returns - `type StructuredSheetResponse struct{…}` Response representing a structured sheet conversion job. This is returned from POST (create), GET (retrieve), and list endpoints. - `ID string` The unique identifier for this structured sheet conversion. - `CreatedAt Time` The timestamp when the conversion was started. - `FileID string` The unique identifier for the source file. - `Object StructuredSheet` The object type, which is always 'structured_sheet'. - `const StructuredSheetStructuredSheet StructuredSheet = "structured_sheet"` - `Status StructuredSheetResponseStatus` The current processing status. - `const StructuredSheetResponseStatusQueued StructuredSheetResponseStatus = "queued"` - `const StructuredSheetResponseStatusInProgress StructuredSheetResponseStatus = "in_progress"` - `const StructuredSheetResponseStatusCompleted StructuredSheetResponseStatus = "completed"` - `const StructuredSheetResponseStatusFailed StructuredSheetResponseStatus = "failed"` - `const StructuredSheetResponseStatusCancelled StructuredSheetResponseStatus = "cancelled"` - `UpdatedAt Time` The timestamp when the conversion was last updated. - `LastError StructuredSheetResponseLastError` Error information when processing fails. - `Code string` A machine-readable error code. - `Message string` A human-readable description of the error. - `SheetNames []string` List of sheet names included in this conversion. - `TableCount int64` Number of tables extracted from the workbook. Only present when status is 'completed'. ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) structuredSheetResponse, err := client.StructuredSheets.New(context.TODO(), deeptable.StructuredSheetNewParams{ FileID: "file_01h45ytscbebyvny4gc8cr8ma2", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", structuredSheetResponse.ID) } ``` #### Response ```json { "id": "ss_01kfxgjd94fn9stqm42nejb627", "created_at": "2024-01-15T10:30:00Z", "file_id": "file_01kfxgjd94fn9stqm414vjb0s8", "object": "structured_sheet", "status": "completed", "updated_at": "2024-01-15T10:35:00Z", "last_error": { "code": "invalid_file_format", "message": "The uploaded file is not a valid Excel spreadsheet." }, "sheet_names": [ "Sheet1", "Financials" ], "table_count": 6 } ``` ## Delete structured sheet `client.StructuredSheets.Delete(ctx, structuredSheetID) (*StructuredSheetDeleteResponse, error)` **delete** `/v1/structured-sheets/{structured_sheet_id}` Delete a structured sheet conversion and its associated exports. This action cannot be undone. ### Parameters - `structuredSheetID string` The unique identifier of the structured sheet conversion. ### Returns - `type StructuredSheetDeleteResponse struct{…}` Response from deleting a structured sheet. Following the OpenAI API convention for delete responses. - `ID string` The unique identifier of the deleted structured sheet. - `Deleted bool` Whether the structured sheet was successfully deleted. - `const StructuredSheetDeleteResponseDeletedTrue StructuredSheetDeleteResponseDeleted = true` - `Object StructuredSheet` The object type, which is always 'structured_sheet'. - `const StructuredSheetStructuredSheet StructuredSheet = "structured_sheet"` ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) structuredSheet, err := client.StructuredSheets.Delete(context.TODO(), "ss_01kfxgjd94fn9stqm42nejb627") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", structuredSheet.ID) } ``` #### Response ```json { "id": "ss_01kfxgjd94fn9stqm42nejb627", "deleted": true, "object": "structured_sheet" } ``` ## Retrieve structured sheet `client.StructuredSheets.Get(ctx, structuredSheetID) (*StructuredSheetResponse, error)` **get** `/v1/structured-sheets/{structured_sheet_id}` Get the status and details of a structured sheet conversion. ### Parameters - `structuredSheetID string` The unique identifier of the structured sheet conversion. ### Returns - `type StructuredSheetResponse struct{…}` Response representing a structured sheet conversion job. This is returned from POST (create), GET (retrieve), and list endpoints. - `ID string` The unique identifier for this structured sheet conversion. - `CreatedAt Time` The timestamp when the conversion was started. - `FileID string` The unique identifier for the source file. - `Object StructuredSheet` The object type, which is always 'structured_sheet'. - `const StructuredSheetStructuredSheet StructuredSheet = "structured_sheet"` - `Status StructuredSheetResponseStatus` The current processing status. - `const StructuredSheetResponseStatusQueued StructuredSheetResponseStatus = "queued"` - `const StructuredSheetResponseStatusInProgress StructuredSheetResponseStatus = "in_progress"` - `const StructuredSheetResponseStatusCompleted StructuredSheetResponseStatus = "completed"` - `const StructuredSheetResponseStatusFailed StructuredSheetResponseStatus = "failed"` - `const StructuredSheetResponseStatusCancelled StructuredSheetResponseStatus = "cancelled"` - `UpdatedAt Time` The timestamp when the conversion was last updated. - `LastError StructuredSheetResponseLastError` Error information when processing fails. - `Code string` A machine-readable error code. - `Message string` A human-readable description of the error. - `SheetNames []string` List of sheet names included in this conversion. - `TableCount int64` Number of tables extracted from the workbook. Only present when status is 'completed'. ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) structuredSheetResponse, err := client.StructuredSheets.Get(context.TODO(), "ss_01kfxgjd94fn9stqm42nejb627") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", structuredSheetResponse.ID) } ``` #### Response ```json { "id": "ss_01kfxgjd94fn9stqm42nejb627", "created_at": "2024-01-15T10:30:00Z", "file_id": "file_01kfxgjd94fn9stqm414vjb0s8", "object": "structured_sheet", "status": "completed", "updated_at": "2024-01-15T10:35:00Z", "last_error": { "code": "invalid_file_format", "message": "The uploaded file is not a valid Excel spreadsheet." }, "sheet_names": [ "Sheet1", "Financials" ], "table_count": 6 } ``` ## Cancel structured sheet processing `client.StructuredSheets.Cancel(ctx, structuredSheetID) (*StructuredSheetResponse, error)` **post** `/v1/structured-sheets/{structured_sheet_id}/cancel` Cancel a structured sheet conversion that is in progress. Only jobs with status 'queued' or 'in_progress' can be cancelled. ### Parameters - `structuredSheetID string` The unique identifier of the structured sheet conversion. ### Returns - `type StructuredSheetResponse struct{…}` Response representing a structured sheet conversion job. This is returned from POST (create), GET (retrieve), and list endpoints. - `ID string` The unique identifier for this structured sheet conversion. - `CreatedAt Time` The timestamp when the conversion was started. - `FileID string` The unique identifier for the source file. - `Object StructuredSheet` The object type, which is always 'structured_sheet'. - `const StructuredSheetStructuredSheet StructuredSheet = "structured_sheet"` - `Status StructuredSheetResponseStatus` The current processing status. - `const StructuredSheetResponseStatusQueued StructuredSheetResponseStatus = "queued"` - `const StructuredSheetResponseStatusInProgress StructuredSheetResponseStatus = "in_progress"` - `const StructuredSheetResponseStatusCompleted StructuredSheetResponseStatus = "completed"` - `const StructuredSheetResponseStatusFailed StructuredSheetResponseStatus = "failed"` - `const StructuredSheetResponseStatusCancelled StructuredSheetResponseStatus = "cancelled"` - `UpdatedAt Time` The timestamp when the conversion was last updated. - `LastError StructuredSheetResponseLastError` Error information when processing fails. - `Code string` A machine-readable error code. - `Message string` A human-readable description of the error. - `SheetNames []string` List of sheet names included in this conversion. - `TableCount int64` Number of tables extracted from the workbook. Only present when status is 'completed'. ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) structuredSheetResponse, err := client.StructuredSheets.Cancel(context.TODO(), "ss_01kfxgjd94fn9stqm42nejb627") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", structuredSheetResponse.ID) } ``` #### Response ```json { "id": "ss_01kfxgjd94fn9stqm42nejb627", "created_at": "2024-01-15T10:30:00Z", "file_id": "file_01kfxgjd94fn9stqm414vjb0s8", "object": "structured_sheet", "status": "completed", "updated_at": "2024-01-15T10:35:00Z", "last_error": { "code": "invalid_file_format", "message": "The uploaded file is not a valid Excel spreadsheet." }, "sheet_names": [ "Sheet1", "Financials" ], "table_count": 6 } ``` ## Download structured sheet export `client.StructuredSheets.Download(ctx, structuredSheetID, query) (*Response, error)` **get** `/v1/structured-sheets/{structured_sheet_id}/download` Download the structured data in the specified format. Only available when conversion status is 'completed'. Available formats: - `sqlite`: SQLite database containing all extracted tables - `cell_labels`: CSV file with cell-level semantic labels ### Parameters - `structuredSheetID string` The unique identifier of the structured sheet conversion. - `query StructuredSheetDownloadParams` - `Format param.Field[StructuredSheetDownloadParamsFormat]` The export format to download. - `const StructuredSheetDownloadParamsFormatSqlite StructuredSheetDownloadParamsFormat = "sqlite"` - `const StructuredSheetDownloadParamsFormatCellLabels StructuredSheetDownloadParamsFormat = "cell_labels"` ### Returns - `type StructuredSheetDownloadResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.StructuredSheets.Download( context.TODO(), "ss_01kfxgjd94fn9stqm42nejb627", deeptable.StructuredSheetDownloadParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` ## Domain Types ### Structured Sheet Response - `type StructuredSheetResponse struct{…}` Response representing a structured sheet conversion job. This is returned from POST (create), GET (retrieve), and list endpoints. - `ID string` The unique identifier for this structured sheet conversion. - `CreatedAt Time` The timestamp when the conversion was started. - `FileID string` The unique identifier for the source file. - `Object StructuredSheet` The object type, which is always 'structured_sheet'. - `const StructuredSheetStructuredSheet StructuredSheet = "structured_sheet"` - `Status StructuredSheetResponseStatus` The current processing status. - `const StructuredSheetResponseStatusQueued StructuredSheetResponseStatus = "queued"` - `const StructuredSheetResponseStatusInProgress StructuredSheetResponseStatus = "in_progress"` - `const StructuredSheetResponseStatusCompleted StructuredSheetResponseStatus = "completed"` - `const StructuredSheetResponseStatusFailed StructuredSheetResponseStatus = "failed"` - `const StructuredSheetResponseStatusCancelled StructuredSheetResponseStatus = "cancelled"` - `UpdatedAt Time` The timestamp when the conversion was last updated. - `LastError StructuredSheetResponseLastError` Error information when processing fails. - `Code string` A machine-readable error code. - `Message string` A human-readable description of the error. - `SheetNames []string` List of sheet names included in this conversion. - `TableCount int64` Number of tables extracted from the workbook. Only present when status is 'completed'. # Tables ## List tables in structured sheet `client.StructuredSheets.Tables.List(ctx, structuredSheetID, query) (*CursorIDPage[TableResponse], error)` **get** `/v1/structured-sheets/{structured_sheet_id}/tables` List all tables extracted from the structured sheet. Only available when conversion status is 'completed'. ### Parameters - `structuredSheetID string` The unique identifier of the structured sheet conversion. - `query StructuredSheetTableListParams` - `After param.Field[string]` A cursor for pagination. Use the `last_id` from a previous response to fetch the next page of results. - `Limit param.Field[int64]` Maximum number of tables to return per page. ### Returns - `type TableResponse struct{…}` Response representing a table extracted from a structured sheet. This is returned from GET (retrieve) and list table endpoints. Table names use a composite format: {normalized_sheet_name}__{table_name}. - `ID string` The unique identifier for this table. - `CreatedAt Time` The timestamp when this table was created. - `Name string` Composite table name: {normalized_sheet_name}__{table_name}. Uses lowercase snake_case. Aggregation tables end with '__aggregations'. Two special metadata tables exist per structured sheet: '__deeptable_workbook_metadata' (workbook provenance info) and '__deeptable_table_overview' (summary of all tables). Example: 'staffing__head_count' or 'staffing__head_count__aggregations'. - `Object Table` The object type, which is always 'table'. - `const TableTable Table = "table"` - `SheetName string` The original Excel sheet name this table came from. - `StructuredSheetID string` The ID of the structured sheet this table belongs to. - `Type TableResponseType` The type of table (relational, aggregation, tableless, or metadata). - `const TableResponseTypeRelational TableResponseType = "relational"` - `const TableResponseTypeAggregation TableResponseType = "aggregation"` - `const TableResponseTypeTableless TableResponseType = "tableless"` - `const TableResponseTypeMetadata TableResponseType = "metadata"` ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) page, err := client.StructuredSheets.Tables.List( context.TODO(), "ss_01kfxgjd94fn9stqm42nejb627", deeptable.StructuredSheetTableListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "data": [ { "id": "tbl_01kfxgjd94fn9stqm45rqr2pnz", "created_at": "2026-01-15T10:35:00Z", "name": "staffing__head_count", "object": "table", "sheet_name": "Staffing", "structured_sheet_id": "ss_01kfxgjd94fn9stqm42nejb627", "type": "relational" }, { "id": "tbl_02abc2def3ghjkmnpqrs4uvwxz", "created_at": "2026-01-15T10:35:00Z", "name": "staffing__head_count__aggregations", "object": "table", "sheet_name": "Staffing", "structured_sheet_id": "ss_01kfxgjd94fn9stqm42nejb627", "type": "aggregation" } ], "has_more": false, "object": "list", "first_id": "tbl_01kfxgjd94fn9stqm45rqr2pnz", "last_id": "tbl_02abc2def3ghjkmnpqrs4uvwxz" } ``` ## Retrieve a table `client.StructuredSheets.Tables.Get(ctx, tableID, query) (*TableResponse, error)` **get** `/v1/structured-sheets/{structured_sheet_id}/tables/{table_id}` Get details of a specific table extracted from the structured sheet. Only available when conversion status is 'completed'. ### Parameters - `tableID string` The unique identifier of the table. - `query StructuredSheetTableGetParams` - `StructuredSheetID param.Field[string]` The unique identifier of the structured sheet conversion. ### Returns - `type TableResponse struct{…}` Response representing a table extracted from a structured sheet. This is returned from GET (retrieve) and list table endpoints. Table names use a composite format: {normalized_sheet_name}__{table_name}. - `ID string` The unique identifier for this table. - `CreatedAt Time` The timestamp when this table was created. - `Name string` Composite table name: {normalized_sheet_name}__{table_name}. Uses lowercase snake_case. Aggregation tables end with '__aggregations'. Two special metadata tables exist per structured sheet: '__deeptable_workbook_metadata' (workbook provenance info) and '__deeptable_table_overview' (summary of all tables). Example: 'staffing__head_count' or 'staffing__head_count__aggregations'. - `Object Table` The object type, which is always 'table'. - `const TableTable Table = "table"` - `SheetName string` The original Excel sheet name this table came from. - `StructuredSheetID string` The ID of the structured sheet this table belongs to. - `Type TableResponseType` The type of table (relational, aggregation, tableless, or metadata). - `const TableResponseTypeRelational TableResponseType = "relational"` - `const TableResponseTypeAggregation TableResponseType = "aggregation"` - `const TableResponseTypeTableless TableResponseType = "tableless"` - `const TableResponseTypeMetadata TableResponseType = "metadata"` ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) tableResponse, err := client.StructuredSheets.Tables.Get( context.TODO(), "tbl_01kfxgjd94fn9stqm45rqr2pnz", deeptable.StructuredSheetTableGetParams{ StructuredSheetID: "ss_01kfxgjd94fn9stqm42nejb627", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tableResponse.ID) } ``` #### Response ```json { "id": "tbl_01kfxgjd94fn9stqm45rqr2pnz", "created_at": "2026-01-15T10:35:00Z", "name": "staffing__head_count", "object": "table", "sheet_name": "Staffing", "structured_sheet_id": "ss_01kfxgjd94fn9stqm42nejb627", "type": "relational" } ``` ## Download table data `client.StructuredSheets.Tables.Download(ctx, tableID, params) (*Response, error)` **get** `/v1/structured-sheets/{structured_sheet_id}/tables/{table_id}/download` Download the table data in the specified format. Available formats: - `parquet`: Apache Parquet columnar format (recommended for data analysis) - `csv`: Comma-separated values (compatible with any spreadsheet application) ### Parameters - `tableID string` The unique identifier of the table. - `params StructuredSheetTableDownloadParams` - `StructuredSheetID param.Field[string]` Path param: The unique identifier of the structured sheet conversion. - `Format param.Field[StructuredSheetTableDownloadParamsFormat]` Query param: The format to download the table data in. - `const StructuredSheetTableDownloadParamsFormatParquet StructuredSheetTableDownloadParamsFormat = "parquet"` - `const StructuredSheetTableDownloadParamsFormatCsv StructuredSheetTableDownloadParamsFormat = "csv"` ### Returns - `type StructuredSheetTableDownloadResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/deeptable-com/deeptable-go" "github.com/deeptable-com/deeptable-go/option" ) func main() { client := deeptable.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.StructuredSheets.Tables.Download( context.TODO(), "tbl_01kfxgjd94fn9stqm45rqr2pnz", deeptable.StructuredSheetTableDownloadParams{ StructuredSheetID: "ss_01kfxgjd94fn9stqm42nejb627", Format: deeptable.StructuredSheetTableDownloadParamsFormatParquet, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` ## Domain Types ### Table Response - `type TableResponse struct{…}` Response representing a table extracted from a structured sheet. This is returned from GET (retrieve) and list table endpoints. Table names use a composite format: {normalized_sheet_name}__{table_name}. - `ID string` The unique identifier for this table. - `CreatedAt Time` The timestamp when this table was created. - `Name string` Composite table name: {normalized_sheet_name}__{table_name}. Uses lowercase snake_case. Aggregation tables end with '__aggregations'. Two special metadata tables exist per structured sheet: '__deeptable_workbook_metadata' (workbook provenance info) and '__deeptable_table_overview' (summary of all tables). Example: 'staffing__head_count' or 'staffing__head_count__aggregations'. - `Object Table` The object type, which is always 'table'. - `const TableTable Table = "table"` - `SheetName string` The original Excel sheet name this table came from. - `StructuredSheetID string` The ID of the structured sheet this table belongs to. - `Type TableResponseType` The type of table (relational, aggregation, tableless, or metadata). - `const TableResponseTypeRelational TableResponseType = "relational"` - `const TableResponseTypeAggregation TableResponseType = "aggregation"` - `const TableResponseTypeTableless TableResponseType = "tableless"` - `const TableResponseTypeMetadata TableResponseType = "metadata"`