Workbooks

Create a workbook

POST
Creates a workbook and adds it to a space

Request

This endpoint expects an object.
name
stringRequired
The name of the Workbook.
labels
list of stringsOptional
An optional list of labels for the Workbook.
spaceId
stringOptional
Space to associate with the Workbook.
environmentId
stringOptional
Environment to associate with the Workbook
namespace
stringOptional
Optional namespace to apply to the Workbook.
sheets
list of objectsOptional
Sheets to create on the Workbook.
actions
list of objectsOptional
Actions to create on the Workbook.
settings
objectOptional
The Workbook settings.
metadata
anyOptional
Metadata for the workbook

Response

This endpoint returns an object
data
object
A collection of one or more sheets

Errors

POST
$curl -X POST https://api.x.flatfile.com/v1/workbooks \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "My First Workbook",
> "labels": [
> "simple-demo"
> ],
> "sheets": [
> {
> "name": "Contacts",
> "fields": [
> {
> "type": "string",
> "key": "firstName",
> "label": "First Name"
> },
> {
> "type": "string",
> "key": "lastName",
> "label": "Last Name"
> },
> {
> "type": "string",
> "key": "email",
> "label": "Email"
> }
> ],
> "slug": "contacts",
> "mappingConfidenceThreshold": 0.5
> }
> ],
> "actions": [
> {
> "label": "Submit",
> "operation": "submitAction",
> "mode": "foreground",
> "description": "Submit data to webhook.site",
> "primary": true
> }
> ],
> "settings": {
> "trackChanges": true
> }
>}'
Response
1{
2 "data": {
3 "id": "us_wb_YOUR_ID",
4 "spaceId": "us_sp_YOUR_ID",
5 "environmentId": "us_env_YOUR_ID",
6 "updatedAt": "2021-01-01T00:00:00Z",
7 "createdAt": "2021-01-01T00:00:00Z",
8 "name": "My First Workbook",
9 "sheets": [
10 {
11 "id": "us_sh_YOUR_ID",
12 "workbookId": "us_wb_YOUR_ID",
13 "name": "Contacts",
14 "slug": "contacts",
15 "config": {
16 "name": "Contacts",
17 "fields": [
18 {
19 "type": "string",
20 "key": "firstName",
21 "label": "First Name"
22 },
23 {
24 "type": "string",
25 "key": "lastName",
26 "label": "Last Name"
27 },
28 {
29 "type": "string",
30 "key": "email",
31 "label": "Email"
32 }
33 ],
34 "slug": "contacts",
35 "mappingConfidenceThreshold": 0.5
36 },
37 "updatedAt": "2021-08-31T18:00:00Z",
38 "createdAt": "2021-08-31T18:00:00Z",
39 "lockedBy": "Example0"
40 }
41 ],
42 "labels": [
43 "simple-demo"
44 ],
45 "actions": [
46 {
47 "label": "Submit",
48 "operation": "submitAction",
49 "mode": "foreground",
50 "description": "Submit data to webhook.site",
51 "primary": true
52 }
53 ],
54 "settings": {
55 "trackChanges": true
56 },
57 "expiredAt": "2021-01-01T00:00:00Z"
58 }
59}