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

# Update a lead

Update a lead by id. <br><br> op is the operation to be performed, and path specifies what resource to patch. <br><br> Use the path leads/0/fieldName to update fields that are user-entered for this resource, i.e. name, description, etc. <br> <br> Use the path leads/0/links/fieldName to update this lead's links to other resources within Nutshell, i.e. contacts, owner, tags, etc. When performing an 'add', include a /- at the end of the path, i.e. leads/0/links/fieldName/- .  <br><br> When using the remove operation, include the id at the end of the path (i.e. leads/0/links/contacts/1-contacts) - no need to include a value. <br><br> To update the value of the lead with a replace operation, use the path leads/0/manualValue with a value of the amount as a string, or leads/0/valueToProductMode without a value to set the lead's value back to the sum of products.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Nutshell API",
    "description": "The most powerful API in the world",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "app.nutshell.com/rest"
    }
  ],
  "paths": {
    "/leads/{id}": {
      "patch": {
        "tags": [
          "Leads"
        ],
        "summary": "Update a lead",
        "description": "Update a lead by id. <br><br> op is the operation to be performed, and path specifies what resource to patch. <br><br> Use the path leads/0/fieldName to update fields that are user-entered for this resource, i.e. name, description, etc. <br> <br> Use the path leads/0/links/fieldName to update this lead's links to other resources within Nutshell, i.e. contacts, owner, tags, etc. When performing an 'add', include a /- at the end of the path, i.e. leads/0/links/fieldName/- .  <br><br> When using the remove operation, include the id at the end of the path (i.e. leads/0/links/contacts/1-contacts) - no need to include a value. <br><br> To update the value of the lead with a replace operation, use the path leads/0/manualValue with a value of the amount as a string, or leads/0/valueToProductMode without a value to set the lead's value back to the sum of products.",
        "operationId": "5a47a634e21ffbad6a5c268af67a63ae",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Lead ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/patchInput"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "No patches sent"
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "patchInput": {
        "type": "array",
        "items": {
          "properties": {
            "op": {
              "description": "The operation to perform",
              "type": "string",
              "enum": [
                "add",
                "remove",
                "replace",
                "move",
                "copy"
              ],
              "example": "add"
            },
            "path": {
              "description": "The path to the attribute to patch. Can be used to update custom fields as well, such as using /leads/0/{customFieldName}",
              "type": "string",
              "example": "/leads/0/links/accounts/337-accounts"
            },
            "value": {
              "description": "The value to set, can be various types, please refer to our guide on JSON Patch for more information",
              "type": "string",
              "example": "337-accounts"
            }
          },
          "type": "object"
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "tags": [
    {
      "name": "Leads",
      "description": "Leads"
    }
  ]
}
```