> ## Documentation Index
> Fetch the complete documentation index at: https://help.commbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Form Link

> This API creates a link to a specified organizational form that can be sent to the customer to fill and/or sign.

**Path Parameters:**
Form ID - appears next to the name of the form in the forms list screen

**Body Parameters:**

**data** (required) - JSON object with:
- **streamProviderId** (required): The identifier of the receiving customer by their phone number or email
- **streamProviderType** (required): The type of the streamProviderId: 4 for email, 5 for phone number
- **referringObjectId** (optional): When the form link is opened, a new form object is created. This can be linked to another object (e.g., the initiating conversation)
- **properties** (optional): JSON object with initial values for form fields. Format: {"field_name": "field_value"}

**autoUpload** (optional) - Boolean:
- When true: System automatically finalizes and uploads the form to S3
- When false (default): System creates a link to send to the customer

## OpenAPI

````json POST /forms/createlink/{FORM_ID}
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/forms/createlink/{FORM_ID}": {
      "post": {
        "tags": [
          "Forms"
        ],
        "summary": "Create Form Link",
        "description": "This API creates a link to a specified organizational form that can be sent to the customer to fill and/or sign.\n\n**Path Parameters:**\nForm ID - appears next to the name of the form in the forms list screen\n\n**Body Parameters:**\n\n**data** (required) - JSON object with:\n- **streamProviderId** (required): The identifier of the receiving customer by their phone number or email\n- **streamProviderType** (required): The type of the streamProviderId: 4 for email, 5 for phone number\n- **referringObjectId** (optional): When the form link is opened, a new form object is created. This can be linked to another object (e.g., the initiating conversation)\n- **properties** (optional): JSON object with initial values for form fields. Format: {\"field_name\": \"field_value\"}\n\n**autoUpload** (optional) - Boolean:\n- When true: System automatically finalizes and uploads the form to S3\n- When false (default): System creates a link to send to the customer",
        "operationId": "Get_New_Form_Link",
        "parameters": [
          {
            "name": "FORM_ID",
            "in": "path",
            "description": "Form Id - Form number (as seen on the forms list screen)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "streamProviderId",
                      "streamProviderType"
                    ],
                    "properties": {
                      "streamProviderId": {
                        "type": "string",
                        "description": "Unique identifier by external provider (WhatsApp, email, etc.) for the original conversation ",
                        "example": "19175552345"
                      },
                      "streamProviderType": {
                        "type": "integer",
                        "description": "The identifier type: 4 for email, 5 for phone number",
                        "example": 5
                      },
                      "referringObjectId": {
                        "type": "integer",
                        "format": "int64",
                        "description": "The object ID of the conversation related to the Form",
                        "example": 312345
                      },
                      "autoUpload": {
                        "type": "boolean",
                        "description": "When 'true', the form is finalized and uploaded to S3 with no additional action required by the customer",
                        "default": false,
                        "example": true
                      },
                      "properties": {
                        "type": "object",
                        "properties": {
                          "field_0": {
                            "type": "string",
                            "example": "John"
                          },
                          "field_1": {
                            "type": "string",
                            "example": "Doe"
                          },
                          "my_own_field": {
                            "type": "string",
                            "example": "abc123"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 200
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation successful"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2024-08-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "conversation_id": {
                          "type": "string",
                          "example": "312345"
                        },
                        "form_link": {
                          "type": "string",
                          "example": "https://apps.commbox.io/form/commbox/499fdc93aa804a4b8266251224944d6a"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request could not be understood by the server. Incoming parameters might not be valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 400
                    },
                    "description": {
                      "type": "string",
                      "example": "Bad Request"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found - The requested resource is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "description": {
                      "type": "string",
                      "example": "Not Found"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server Error - The server could not return the representation due to an internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Internal Server Error"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
````

