---
updatedAt: 2025-04-25T09:55:31.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Update Flow Json

Use this API to update the flow json.

## Request Parameters

| Key           | Description                      | Value                     | Data type | Required/Optional | Constraints                                |
| :------------ | :------------------------------- | :------------------------ | :-------- | :---------------- | :----------------------------------------- |
| Authorization | Access Token for the application | \{\{PARTNER\_APP\_TOKEN}} | String    | Required          | Should be a valid Partner App Access Token |
| appId         | App id of the app                | \{\{APP\_ID}}             | String    | Required          | The Id should be a valid app Id of Gupshup |
| flowId        | Flow Id                          | \{\{FLOW\_ID}}            | String    | Required          | Flow Id generated by Meta                  |
| file          | File path                        | \{\{FILE\_PATH}}          | file      | Required          |                                            |

## Sample Request

```curl
curl --location --request PUT 'https://partner.gupshup.io/partner/app/{{APP_ID}}/flows/{{FLOW_ID}}/assets' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/json' \
--form 'file={{FILE_PATH}}'
```

## Sample Response

```
{
    "status": "success",
    "success": true,
    "validation_errors": []
}
```

## Status Codes

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Status Code
      </th>

      <th>
        Response
      </th>

      <th>
        Comments
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Success**
      </td>

      <td>

      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        200
      </td>

      <td>
        \{
          
            "status": "success",
            "success": true,
            "validation_errors": []
        }
      </td>

      <td>
        Successfully updated json
      </td>
    </tr>

    <tr>
      <td>
        **Error**
      </td>

      <td>

      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        400
      </td>

      <td>
        \{
          
            "status": "error",
            "message": "Unable to upload Flow JSON Asset as media size is greater than permitted size"
        }
      </td>

      <td>
        For updating json over 10MB
      </td>
    </tr>
  </tbody>
</Table>

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Partner Portal API",
    "description": "Partner Portal API documentation",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.gupshup.io"
    },
    "version": "3.0.0-SNAPSHOT"
  },
  "externalDocs": {
    "description": "Gupshup Wiki Documentation",
    "url": "https://www.gupshup.io/partner/docs"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io/partner",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Flow management",
      "description": "API's for partners flow management"
    }
  ],
  "paths": {
    "/app/{appId}/flows/{flowId}/assets": {
      "put": {
        "tags": [
          "Flow management"
        ],
        "summary": "Update Flow Json",
        "operationId": "updateflowjson",
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your app token, please refer [**Get access token api**](https://partner-docs.gupshup.io/reference/get_partner-app-appid-token#/) to get the token from partner documentation.",
            "example": "sk_345095d735c64a8ab2f97a92e953xxxx"
          },
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the app.",
            "example": "a41b30f4-d202-4fdb-911e-3a8fbfbfxxxx"
          },
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Flow Id generated by Meta",
            "example": "90381197123xxxx"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Json file to be updated"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "validation_errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      },
                      "example": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - no permissions to access resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "required": [
          "entity",
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "Status Code",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "Error message describing the reason "
          },
          "details": {
            "type": "string",
            "description": "Developer specific error details "
          },
          "code": {
            "type": "string",
            "description": "Internal Error Code",
            "default": "PP-ERR-XXX"
          },
          "entity": {
            "type": "object",
            "description": "Response Object"
          }
        },
        "description": "Error"
      }
    }
  }
}
```