Skip to content

[POST] Create Batch⚓︎

Use this request to create a new Batch in a given Workspace.

You can use batches to process and organize Tasks together.

Create Batch⚓︎

POST/api/v1.0/external/sdbatch

Batches and Workspaces

All batches are tied to a Workspace. You can have multiple batches per workspace, and you can mix tasks with or without a batch in the same workspace.

Body application/json CreateBatchRequest⚓︎

NameTypeDescription
displayNamestringA required display name for your batch.
descriptionstring (optional)An optional description for your batch.
workspaceIdinteger (optional)The ID of the workspace to add this batch to. Note, each workspace processes a specific Task Type - since a batch is tied to its workspace, all tasks in the batch will have the same Task Type as the workspace. If not specified, the default workspace in your tenant is used.

Example Request⚓︎

curl --location 'https://cloud.smartdocumentor.net/api/v1.0/external/sdbatch' \
--header 'Authorization: Bearer null' \
--header 'Content-Type: application/json' \
--data '{
    "displayName": "YourBatchName",
    "description": "AnOptionalDescriptionForYourBatch"
}'
var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://cloud.smartdocumentor.net/api/v1.0/external/sdbatch");
request.Headers.Add("Authorization", "Bearer null");

var content = new StringContent("{\r\n    \"displayName\": \"YourBatchName\",\r\n    \"description\": \"AnOptionalDescriptionForYourBatch\"\r\n}", null, "application/json");
request.Content = content;

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();

Console.WriteLine(await response.Content.ReadAsStringAsync());
import requests
import json

url = "https://cloud.smartdocumentor.net/api/v1.0/external/sdbatch"

payload = json.dumps({
  "displayName": "YourBatchName",
  "description": "AnOptionalDescriptionForYourBatch"
})
headers = {
  'Authorization': 'Bearer null',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer null");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "displayName": "YourBatchName",
  "description": "AnOptionalDescriptionForYourBatch"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://cloud.smartdocumentor.net/api/v1.0/external/sdbatch", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

You can use the Create Task request to create tasks and add them to a previously created Batch.

Responses⚓︎

{
  "batchId": 1,
  "workspaceId": 1,
  "displayName": "YourBatchName",
  "description": "AnOptionalDescriptionForYourBatch",
  "createdOn": "2023-08-08T08:55:29.7831583Z",
  "totalTasks": 0,
  "totalTasksInHistory": 0
}

Response Body GetBatchResponse⚓︎

NameTypeDescription
batchIdintegerThe unique identifier assigned to your batch.
workspaceIdintegerThe workspace ID you assigned to this batch, or the ID of the default Workspace in your Organization, if none was provided.
displayNamestringThe display name you assigned to your batch.
descriptionstring (optional)The description you provided to your batch.
createdOndatetimeUTC timestamp of when the batch was created in our system.
totalTasksintegerThe total number of tasks assigned to this batch. Will always equal zero when the task is created.
totalTasksInHistoryintegerThe total number of tasks in history assigned to this batch. Will always equal zero when the task is created.

Response body has no content.

Info

Note Returned if:

  • the workspace provided (or the default workspace) is not valid or does not exist in your Organization.