# update_project

**Update project group** · Changes data

Rename the group or replace project-label assignments across all its marketplaces.

- Omitted fields stay unchanged.
- Removing any assignment returns a plan for the complete mixed change without mutation; show exact effects and wait for explicit confirmation before `execute_removal`.
- `project_id` identifies a marketplace project, not its group.

**Cost and limits:** Pure additions, renames and no-op updates commit immediately and cost 5 credits.

## Input

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `integer` | Required | A marketplace project ID: `list_projects` `data.projects[].marketplaces[].project_id`, not a project group. Minimum 1. Maximum 2147483647. |
| `project_name` | `string` | Optional | Project-group name. Surrounding ASCII whitespace is trimmed; matching names join the existing group. Maximum length 10000. |
| `label_ids` | `integer[]` | Optional | Replacement project-label IDs for every marketplace in the group. Omit to retain assignments. At most 1000 items. |

## Output

Read this object from the result's `structuredContent`. The result's `content` carries a text version for the model, which is not always the same JSON.

The result is one of 2 shapes.

### Variant 1

Fields of `data`:

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `plan_reference` | `string` | Required | Pattern `^[A-Za-z0-9_-]{43}$`. |
| `operation` | `string` | Required |  |
| `expires_at` | `string (date-time)` | Required |  |
| `targets` | `object[]` | Required |  |
| `consequences` | `object[]` | Required |  |
| `instructions` | `string` | Required |  |


### Variant 2

Fields of `data`:

| Name | Type | Required |
| --- | --- | --- |
| `operation` | `"update_project"` | Required |
| `committed` | `true` | Required |
| `recovered` | `boolean` | Required |
| `outcome` | `object` | Required |

#### `data.outcome`

| Name | Type | Required |
| --- | --- | --- |
| `project` | `ProjectSummary` | Required |

<details>
<summary>Full input and output JSON Schema</summary>

```json
{
  "inputSchema": {
    "type": "object",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "project_id": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2147483647,
        "description": "A marketplace project ID: list_projects data.projects[].marketplaces[].project_id, not a project group."
      },
      "project_name": {
        "type": "string",
        "maxLength": 10000,
        "description": "Project-group name. Surrounding ASCII whitespace is trimmed; matching names join the existing group."
      },
      "label_ids": {
        "maxItems": 1000,
        "type": "array",
        "items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2147483647
        },
        "description": "Replacement project-label IDs for every marketplace in the group. Omit to retain assignments."
      }
    },
    "required": [
      "project_id"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "data"
    ],
    "anyOf": [
      {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "plan_reference",
              "operation",
              "expires_at",
              "targets",
              "consequences",
              "instructions"
            ],
            "properties": {
              "plan_reference": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{43}$"
              },
              "operation": {
                "type": "string"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "targets": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "consequences": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "instructions": {
                "type": "string"
              }
            }
          }
        }
      },
      {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "operation",
              "committed",
              "recovered",
              "outcome"
            ],
            "properties": {
              "operation": {
                "const": "update_project"
              },
              "committed": {
                "const": true
              },
              "recovered": {
                "type": "boolean"
              },
              "outcome": {
                "type": "object",
                "required": [
                  "project"
                ],
                "properties": {
                  "project": {
                    "$ref": "#/$defs/ProjectSummary"
                  }
                }
              }
            }
          }
        }
      }
    ],
    "$defs": {
      "ProjectSummary": {
        "type": "object",
        "required": [
          "project_id",
          "project_name",
          "created_at",
          "marketplace",
          "should_track_variations",
          "keywords_count",
          "asins_count",
          "labels"
        ],
        "properties": {
          "project_id": {
            "type": "integer"
          },
          "project_name": {
            "type": "string"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Creation date, or null when no creation date is stored."
          },
          "marketplace": {
            "type": "string"
          },
          "should_track_variations": {
            "type": "boolean",
            "description": "Whether rank metrics also count tracked variations of each ASIN. Shared by every marketplace project in the group."
          },
          "keywords_count": {
            "type": "integer",
            "description": "Keywords attached to this marketplace project."
          },
          "asins_count": {
            "type": "integer",
            "description": "ASINs attached to this marketplace project."
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/Label"
            }
          }
        }
      },
      "Label": {
        "type": "object",
        "required": [
          "label_id",
          "label_name",
          "color"
        ],
        "properties": {
          "label_name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "label_id": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          }
        },
        "description": "A label assigned in this result. The default app color is returned as `gray`."
      }
    }
  }
}
```

</details>
