For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
CommunityCreate AccountSign in
  • Overview
    • Welcome
    • Authentication
    • Using Environments
  • API Reference
      • GETList jobs
      • POSTCreate a job
      • GETGet a job
      • PATCHUpdate a job
      • DELDelete a job
      • POSTExecute a job
      • GETGet a job's execution plan
      • PUTReplace a job's plan
      • PATCHUpdate a job's plan
      • POSTAcknowledge a job
      • POSTAcknowledge a job outcome
      • POSTComplete a job
      • POSTFail a job
      • POSTCancel a job
      • POSTRetry a failed job
      • POSTPreview a mutation
      • POSTSplit a job
LogoLogo
LogoLogo
CommunityCreate AccountSign in
API ReferenceJobs

Replace a job's plan

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

Update a job's plan

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

jobIdstringRequired
ID of job to return

Headers

X-Disable-Hooks"true"Required

Request

This endpoint expects an object.
fieldMappinglist of objectsRequired
fileIdstringRequired
File ID
jobIdstringRequired
Pipeline Job ID
unmappedDestinationFieldslist of objectsRequired
unmappedSourceFieldslist of objectsRequired
programIdstringOptional

Response

This endpoint returns an object.
dataobject

The job/plan tuple that contains the full plan and the jobs status