Skip to main content

Delete a Running Job


Delete a Running Job

This REST API deletes the current job, only if the job is not complete. If the job is complete, an error is thrown.


Environment Request
US Production POST{jobid}
US API Sandbox POST{jobid}
US Performance Test POST{jobid}
US Cloud Production POST{jobid}
US Cloud API Sandbox POST{jobid}
US Central Sandbox POST{jobid}
EU Cloud Production POST{jobid}
EU Cloud API Sandbox POST{jobid}
EU Central Sandbox POST{jobid}

Response Parameters


The name of the job. 32 character limit.


The job ID created for the AQuA API request. The job ID can be used for querying for the query status.
The ID exists only if the JSON request can be parsed and validated successfully. Otherwise, the job ID is null.


The API version you want to use. Supported versions:

  • 1.1 Supports both modes
  • 1.0 Default. Supports Stateless mode only

See Stateless and Stateful Modes for more information.


The supported values are csv, zip and gzip. The default value is csv.


The job status. Status types are:

  • Submitted: The job was successfully submitted upon successful validation of the JSON request.
  • Executing: The job is being processed.
  • Completed: The query was executed successfully. Click completed to download a gzip archive of the results.
  • Error: There are some validation errors in the JSON input, and the job ID will not be available.
  • Aborted: The execution stopped because one of the queries failed. Check the error code and error messages for more details.
  • Pending: The job is extracting data from the database.


A JSON array object that contains a list of batch objects.


Name of the query supplied in the request.


The error message. The maximum size is 2048.


The requested query string.


The status of the batch execution:

  • pending: The query was validated and submitted to the query executor for processing.
  • executing: The query is being processed.
  • completed: The query was successfully executed.
  • aborted: The query execution failed.
  • cancelled: The query was not processed.


The number of records included in the query output file.


The ID of the query results file.

Use Get Results Files to download the query results file. The query results file is formatted as requested in the batch job. Supported formats are CSV, GZIP, and ZIP.


A 32-character ID of the query batch.


The kind of batch job being submitted. Possible values are zoql or zoqlexport.


The array of file IDs are sorted alphanumerically. Column headers are repeated in each segment. 

JSON Example

HTTP request: 



JSON response:


    "name": "June10",

    "id": "e20b07474688ad5001468daf10e501de",

    "version": "1.1",

    "format": "CSV",

    "status": "cancelled",

    "batches": [


            "name": "InvoiceItemAdjustment",

            "message": "",

            "query": "select AccountingCode,CancelledDate,CreatedDate,Id,InvoiceId,InvoiceItemName,


            Amount,Status,AccountId,SourceId,Type,ReasonCode, UpdatedDate  from  InvoiceItemAdjustment",

            "status": "completed",

            "recordCount": 1580,

            "fileId": "e20b07474688ad5001468daf155f01f5",

            "batchId": "e20b07474688ad5001468daf10ea01df",

            "batchType": "zoqlexport"



            "name": "InvoiceAdjustment",

            "message": "",

            "query": "select AccountingCode,CancelledOn,CreatedDate,Id,ImpactAmount,Invoice.Id,


            UpdatedDate  from  InvoiceAdjustment",

            "status": "completed",

            "recordCount": 411,

            "fileId": "e20b07474688ad5001468daf166601f6",

            "batchId": "e20b07474688ad5001468daf10ec01e0",

            "batchType": "zoqlexport"



    "encrypted": "none"


Curl Example

Curl request:

echo "============= Aqua Job Delete ===========" 
echo curl -i -k -u $USER_NAME:$PASSWORD -H "Accept:application/json" -X DELETE $BASE_URL/api/batch-query/jobs/$JOBID

Curl response:

HTTP/1.1 200 OK 
Server: Apache-Coyote/1.1 
Content-Type: application/json 
Transfer-Encoding: chunked 
Date: Fri, 05 Sep 2014 11:52:30 GMT 
 "name": "DSEXPORT", 
 "id": "2c90839d46f936820146fd4ef77a1eb6", 
 "version": "1.1", 
 "format": "CSV", 
 "status": "cancelled", 
 "encrypted": "none", 
 "batches": [ 
       "name": "Account", 
       "query": "select AccountNumber,Id,CreditBalance,Name,Balance,TaxExemptStatus,AutoPay,Currency,PaymentGateway,PaymentTerm,SalesRepName,TaxExemptIssuingJurisdiction,TaxExemptEffectiveDate,TaxExemptExpirationDate,TaxExemptCertificateType,LastInvoiceDate,Status,TotalInvoiceBalance,CreatedDate,UpdatedDate, ParentId, CustomerServiceRepName, BillToContact.Id, SoldToContact.Id from Account", 
       "status": "completed", 
       "recordCount": 1322, 
       "batchType": "zoqlexport", 
       "batchId": "2c90839d46f936820146fd4ef77f1eb7", 
       "segments": [ 
     "name": "AccountingPeriod", 
     "query": "select Id,StartDate,EndDate,FiscalYear,Name,Status,UpdatedDate from AccountingPeriod", 
     "status": "submitted", 
     "recordCount": 0, 
     "batchType": "zoqlexport", 
     "batchId": "2c90839d46f936820146fd4ef7951ecc", 
     "segments": [ "2c90839d46f936820146fd4f061e23cf"