**Source URL:** https://limited.veevavault.dev/medical/vault-api/api-reference/21.3/managing-vault-java-sdk/add-or-replace-single-source-code-file.md

# Add or Replace Single Source Code File



<Aside>We do not recommend using the following endpoint to deploy code as you may introduce code which breaks existing deployed code. For best practices, use the [VPK Deploy method](/vault-sdk/deploying-code/).

</Aside>
Add or replace a single `.java` file in the currently authenticated Vault. If the given file does not already exist in the Vault, it is added. If the file already exists in the Vault, the file is updated.

<Endpoint path="/api/{version}/code" method="PUT"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Accept` | `application/json` (default) |
| `Content-Type` | `multipart/form-data` |
</FieldTable>

## Body Parameters {#body-parameters}

## Request {#request}

<CodeExample title="">
```
curl -X PUT -H "Authorization: {SESSION_ID}" \
https://veepharm.veevavault.com/api/v18.3/code
-F "file=@C:\Vault\Extensions\com\veeva\vault\custom\actions\MyCustomAction.java" \

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "responseMessage": "Modified file",
    "url": "/api/v18.3/code/com.veeva.vault.custom.actions.MyCustomAction"
}

```
</CodeExample>

---

**Previous:** [Enable or Disable Vault Extension](/medical/vault-api/api-reference/21.3/managing-vault-java-sdk/enable-or-disable-vault-extension)  
**Next:** [Delete Single Source Code File](/medical/vault-api/api-reference/21.3/managing-vault-java-sdk/delete-single-source-code-file)