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

# Update Submission

> Update a submission. Requires `forms-write` ability.

# Update Submission

Modify an existing submission's answers. This endpoint is useful when you want to correct values or enrich a submission after it was created.

## Authentication & Scope

Requires `forms-write` ability.

## Request

```http theme={null}
PUT /open/forms/{id}/submissions/{submission_id} HTTP/1.1
Host: api.opnform.com
Content-Type: application/json
Authorization: Bearer <token>
```

### Path Parameters

| Parameter      | Type   | Description                              |
| -------------- | ------ | ---------------------------------------- |
| id             | number | ID of the parent form.                   |
| submission\_id | number | ID of the submission you want to update. |

### Body Parameters

The payload should be an object whose keys correspond to the **field IDs** in the form definition. You only need to send the fields you intend to change. Other special meta-fields:

| Field            | Type    | Description                      |
| ---------------- | ------- | -------------------------------- |
| completion\_time | integer | Optional; total time in seconds. |

Example (updating two answers):

```json theme={null}
{
  "field_name": "Alice",
  "field_email": "alice@example.com",
  "completion_time": 125
}
```

## Response

`200 OK` – Returns the updated `Submission` object plus a success message.

```json theme={null}
{
  "message": "Record successfully updated.",
  "data": {
    "submission_id": 17,
    "form_id": 99,
    "submitted_at": "2024-06-12T10:11:12Z",
    "data": {
      "field_name": "Alice",
      "field_email": "alice@example.com"
    }
  }
}
```

`403 Forbidden` – Token lacks `forms-write` or you do not have permission.


## OpenAPI

````yaml put /open/forms/{id}/submissions/{submission_id}
openapi: 3.0.1
info:
  title: OpnForm API
  description: API for interacting with OpnForm, primarily used for Zapier integration
  version: 1.0.0
servers:
  - url: https://api.opnform.com
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Create and manage workspaces.
  - name: Workspace Users
    description: Manage users within a workspace.
  - name: Forms
    description: Manage and retrieve forms.
  - name: Submissions
    description: Access and manage form submissions.
  - name: Integrations
    description: Manage form integrations (webhooks) via API.
  - name: Zapier
    description: Legacy endpoints for the Zapier integration.
paths:
  /open/forms/{id}/submissions/{submission_id}:
    put:
      tags:
        - Submissions
      summary: Update Submission
      description: Update a submission. Requires `forms-write` ability.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: number
        - name: submission_id
          in: path
          required: true
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Submission'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Submission'
        '403':
          description: Forbidden – token lacks forms-write ability
      security:
        - bearerAuth: []
components:
  schemas:
    Submission:
      type: object
      properties:
        id:
          type: number
          description: Unique submission ID
          readOnly: true
        form_id:
          type: number
          description: ID of the parent form
          readOnly: true
        completion_time:
          type: number
          nullable: true
          description: Time taken to complete the form in seconds
          readOnly: true
        data:
          type: object
          description: Contains form field responses plus metadata (status, created_at, id)
          additionalProperties: true
          readOnly: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Personal Access Token
      x-bearer-scopemap:
        workspaces-read: Read access to workspaces
        workspaces-write: Write access to workspaces
        workspace-users-read: Read access to workspace users
        workspace-users-write: Write access to workspace users
        forms-read: Read access to forms
        forms-write: Write access to forms
        manage-integrations: Manage form integrations (webhooks)

````