Skip to content
Get started

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.

ParametersExpand Collapse
structuredSheetID string

The unique identifier of the structured sheet conversion.

ReturnsExpand Collapse
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.

formatdate-time
FileID string

The unique identifier for the source file.

Object StructuredSheet

The object type, which is always 'structured_sheet'.

Status StructuredSheetResponseStatus

The current processing status.

One of the following:
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.

formatdate-time
LastError StructuredSheetResponseLastErroroptional

Error information when processing fails.

Code string

A machine-readable error code.

maxLength64
Message string

A human-readable description of the error.

maxLength1024
SheetNames []stringoptional

List of sheet names included in this conversion.

TableCount int64optional

Number of tables extracted from the workbook. Only present when status is 'completed'.

minimum0

Cancel structured sheet processing

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)
}
{
  "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
}
Returns Examples
{
  "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
}