---
title: "Create and submit new record in the workflow and stage"
method: POST
path: "/api/Public/submit"
tags: ["Public"]
---

# Create and submit new record in the workflow and stage

`POST /api/Public/submit`

## Request

- Base URL: `https://apidocs.cflowapps.com` (the document declares no server; this is the origin it was published from)
- URL: `https://apidocs.cflowapps.com/api/Public/submit`
- Auth: API key in header `X-Api-Key` and API key in header `X-User-Key`
- TypeScript: <https://skmtc.dev/cflowapps/apis/cflow-public-api/docs/api/Public/submit/post.ts> (a function with typed inputs; its response is checked against the schema)

Sample Request

         POST
         {
           "WorkflowName": "Test Workflow",
           "StageName": "Approval stage",  
           "IsDraft": false,        ///           
           "Values":{"Product Name":"Test Data","Product code":"1"}, //All section data except table sections
           "TableValues":[{
               "TableName":"Employees", //Name of the table
               "Values":{   // All field values seperated by '|!' symbol
                   "Name":"xyz|!abc",      // "Fieldname":"all fieldvalues of the field"
                   "Designation":"Engg|!Marketing"
               }
           },
           {
               "TableName":"Employees", //Name of the table
               "Values":{   // All field values seperated by '|!' symbol
                   "Name":"xyz|!abc",      // "Fieldname":"all fieldvalues of the field"
                   "Designation":"Engg|!Marketing"
               }
           }]
           "IsWorkflow": true
        }

## Request body

- SubmitRequest
  - `workflowName` string, required: Name of the workflow / lookup
  - `stageName` string, required: For workflows, enter the workflow stage display name as stage name. For lookup workflows, enter the lookup name as the stage name
  - `isDraft` boolean, required: Save the record as draft or not. True - If this need to be saved as draft, False - If needs to be submitted.
  - `values` unknown, required
  - `tableValues` TableValue[], required: Table section data
    - `tableName` string, required: Table section name
    - `values` unknown
  - `isWorkflow` boolean: True for Workflows (default) and False for Lookups

## Response `200`

Return status of the request

- SubmitResponse
  - `recordId` string, nullable: Record Id
  - `status` string, nullable: Status of the Submitted Record
  - `message` string, nullable: Message provided when there is an invalid input

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Unable to submit the record
- `500`: Internal Server Error

---

[API](https://skmtc.dev/cflowapps/apis/cflow-public-api.md) - [All operations](https://skmtc.dev/cflowapps/apis/cflow-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cflowapps/apis/cflow-public-api/revisions/af0dadd0ad10?raw)
