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

# update

<Tip>
  Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
</Tip>

[Source: node-sdk/src/functions.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/functions.ts)

Upload a new version of the code, mirroring `function.update(path=...)`.

```typescript theme={null}
NotteFunction.update(options: FunctionUpdateOptions): Promise<FunctionResponse>;
```

## Parameters

<ParamField body="options" type={"FunctionUpdateOptions"} required>
  Local Python file path, optional version, and code-access settings.
</ParamField>

## Returns

```typescript theme={null}
Promise<FunctionResponse>
```

Updated function metadata, including its latest version.

## Raises

* InvalidRequestError if the path is missing or does not end in `.py`.
* NotteAPIError if the upload is rejected.

## Example

```typescript theme={null}
const updated = await fn.update({ path: './scraper.py' });
console.log(updated.latest_version);
```

## Related types

* [FunctionResponse](/typescript-sdk-reference/types/functionresponse)
* [FunctionUpdateOptions](/typescript-sdk-reference/types/functionupdateoptions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.