Jobs

Replace a job's plan

PUT
Update a job's entire execution plan

Path parameters

jobIdstringRequired
ID of job to return

Request

This endpoint expects an object.
fieldMapping
list of objectsRequired
fileId
stringRequired
File ID
jobId
stringRequired
Pipeline Job ID
unmappedDestinationFields
list of objectsRequired
unmappedSourceFields
list of objectsRequired
programId
stringOptional

Response

This endpoint returns an object
data
object
The job/plan tuple that contains the full plan and the jobs status
PUT
$curl -X PUT https://api.x.flatfile.com/v1/jobs/us_jb_YOUR_ID/plan \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "fieldMapping": [
> {
> "sourceField": {
> "type": "string",
> "key": "firstName"
> },
> "destinationField": {
> "type": "string",
> "key": "firstName",
> "label": "First Name"
> }
> },
> {
> "sourceField": {
> "type": "string",
> "key": "lastName"
> },
> "destinationField": {
> "type": "string",
> "key": "lastName",
> "label": "Last Name"
> }
> }
> ],
> "fileId": "us_fl_YOUR_ID",
> "jobId": "us_jb_YOUR_ID",
> "unmappedDestinationFields": [
> {
> "destinationField": {
> "type": "string",
> "key": "email",
> "label": "Email"
> }
> }
> ],
> "unmappedSourceFields": [
> {
> "sourceField": {
> "type": "string",
> "key": "email"
> }
> }
> ]
>}'
Response
1{
2 "data": {
3 "job": {
4 "createdAt": "2023-10-30T20:04:28.556Z",
5 "id": "us_jb_YOUR_ID",
6 "operation": "submitAction",
7 "source": "us_wb_YOUR_ID",
8 "type": "workbook",
9 "updatedAt": "2023-10-30T20:04:32.075Z",
10 "destination": "us_wb_YOUR_ID",
11 "environmentId": "us_env_YOUR_ID",
12 "fileId": "us_fl_YOUR_ID",
13 "finishedAt": "2023-10-30T20:04:32.074Z",
14 "info": "Starting job to submit action to webhook.site",
15 "input": {},
16 "managed": true,
17 "mode": "foreground",
18 "outcome": {
19 "message": "Data was successfully submitted to Webhook.site. Go check it out at https://example.site/example."
20 },
21 "progress": 100,
22 "startedAt": "2023-10-30T20:04:29.453Z",
23 "status": "complete",
24 "subject": {
25 "type": "resource",
26 "id": "us_wb_YOUR_ID"
27 },
28 "trigger": "immediate",
29 "config": {}
30 },
31 "plan": {
32 "fieldMapping": [
33 {
34 "sourceField": {
35 "type": "string",
36 "key": "firstName"
37 },
38 "destinationField": {
39 "type": "string",
40 "key": "firstName",
41 "label": "First Name"
42 },
43 "preview": [
44 "John",
45 "Suzy",
46 "Joe"
47 ],
48 "metadata": {
49 "certainty": "absolute",
50 "confidence": 1,
51 "source": "exact"
52 }
53 },
54 {
55 "sourceField": {
56 "type": "string",
57 "key": "lastName"
58 },
59 "destinationField": {
60 "type": "string",
61 "key": "lastName",
62 "label": "Last Name"
63 },
64 "preview": [
65 "Smith",
66 "Que",
67 "Montana"
68 ],
69 "metadata": {
70 "certainty": "absolute",
71 "confidence": 1,
72 "source": "exact"
73 }
74 }
75 ],
76 "unmappedSourceFields": [],
77 "unmappedDestinationFields": []
78 }
79 }
80}