# Update Form Submission

PATCH https://api.webflow.com/v2/sites/{site_id}/form_submissions/{form_submission_id}
Content-Type: application/json

Update hidden fields on a form submission within a specific site.

Required scope | `forms:write`


Reference: https://developers.webflow.com/data/reference/forms/form-submissions/update-submission

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Modify Form Submission by Site
  version: endpoint_sites/forms.update-submission
paths:
  /sites/{site_id}/form_submissions/{form_submission_id}:
    patch:
      operationId: update-submission
      summary: Modify Form Submission by Site
      description: |
        Update hidden fields on a form submission within a specific site.

        Required scope | `forms:write`
      tags:
        - - subpackage_sites
          - subpackage_sites/forms
      parameters:
        - name: site_id
          in: path
          description: Unique identifier for a Site
          required: true
          schema:
            type: string
            format: objectid
        - name: form_submission_id
          in: path
          description: Unique identifier for a Form Submission
          required: true
          schema:
            type: string
            format: objectid
        - name: Authorization
          in: header
          description: >-
            Bearer authentication of the form `Bearer <token>`, where token is
            your auth token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Request was successful
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/sites_forms_update-submission_Response_200
        '400':
          description: Request body was incorrectly formatted.
          content: {}
        '401':
          description: >-
            Provided access token is invalid or does not have access to
            requested resource
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Requested resource not found
          content: {}
        '409':
          description: To access this feature, the site needs to be republished.
          content: {}
        '429':
          description: >-
            The rate limit of the provided access_token has been reached. Please
            have your application respect the X-RateLimit-Remaining header we
            include on API responses.
          content: {}
        '500':
          description: We had a problem with our server. Try again later.
          content: {}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                formSubmissionData:
                  $ref: >-
                    #/components/schemas/SitesSiteIdFormSubmissionsFormSubmissionIdPatchRequestBodyContentApplicationJsonSchemaFormSubmissionData
                  description: >-
                    An existing **hidden field** defined on the form schema, and
                    the corresponding value to set
components:
  schemas:
    SitesSiteIdFormSubmissionsFormSubmissionIdPatchRequestBodyContentApplicationJsonSchemaFormSubmissionData:
      type: object
      properties: {}
    SitesSiteIdFormSubmissionsFormSubmissionIdPatchResponsesContentApplicationJsonSchemaFormResponse:
      type: object
      properties: {}
    sites_forms_update-submission_Response_200:
      type: object
      properties:
        id:
          type: string
          format: objectid
          description: The unique ID of the Form submission
        displayName:
          type: string
          description: The Form name displayed on the site
        siteId:
          type: string
          format: objectid
          description: The unique ID of the Site the Form belongs to
        workspaceId:
          type: string
          format: objectid
          description: The unique ID of the Workspace the Site belongs to
        dateSubmitted:
          type: string
          format: date-time
          description: Date that the Form was submitted on
        formResponse:
          $ref: >-
            #/components/schemas/SitesSiteIdFormSubmissionsFormSubmissionIdPatchResponsesContentApplicationJsonSchemaFormResponse
          description: The data submitted in the Form

```

## SDK Code Examples

```python
from webflow import Webflow

client = Webflow(
    access_token="YOUR_ACCESS_TOKEN",
)
client.sites.forms.update_submission(
    site_id="580e63e98c9a982ac9b8b741",
    form_submission_id="580e63e98c9a982ac9b8b741",
)

```

```typescript
import { WebflowClient } from "webflow-api";

const client = new WebflowClient({ accessToken: "YOUR_ACCESS_TOKEN" });
await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741");

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
HttpResponse<String> response = Unirest.patch("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
var client = new RestClient("https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.webflow.com/v2/sites/580e63e98c9a982ac9b8b741/form_submissions/580e63e98c9a982ac9b8b741")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```