> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.phonic.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.phonic.ai/_mcp/server.

# Update

PATCH https://api.phonic.ai/v1/projects/{nameOrId}
Content-Type: application/json

Updates a project by name or ID.

Reference: https://docs.phonic.ai/api-reference/projects/update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication header of the form `Bearer <PHONIC_API_KEY>`. Manage your API keys [here](https://phonic.co/api-keys).

## Request

### Path parameters

- `nameOrId` (string, required) — The name or the ID of the project to update.

### Body (application/json)

This endpoint expects an UpdateProjectRequest.

- `name` (string, optional) — The name of the project. Can only contain lowercase letters, numbers and hyphens. Must be unique within the workspace.
- `default_agent` (string, optional, nullable) — The name of the new project's default agent. Set to `null` to remove the default agent.
- `max_active_conversations` (integer, optional, nullable) — Maximum number of concurrent conversations allowed for this project. When `null`, the workspace `max_active_conversations` limit is used.

## Response

### 200

Success response

- `success` (boolean, required) — Whether the project was updated successfully.

## Errors

### 400 Bad Request Error

Invalid parameters

- `error` (ValidationErrorError, required)
- `param_errors` (map from string to string, required) — Parameter-specific validation errors

### 401 Unauthorized Error

Unauthorized (authentication missing or invalid)

- `error` (BasicErrorError, optional)

### 403 Forbidden Error

Forbidden

- `error` (BasicErrorError, optional)

### 404 Not Found Error

Project not found

- `error` (BasicErrorError, optional)

### 500 Internal Server Error

Internal server error

- `error` (BasicErrorError, optional)

## Types

### ValidationErrorError

- `message` (string, required) — Error message

### BasicErrorError

- `message` (string, required) — Error message
- `code` (string, optional) — Error code

## Examples

### Update project response

**Response**

```json
{
  "success": true
}
```

**SDK Code**

```python Update project response
import requests

url = "https://api.phonic.ai/v1/projects/nameOrId"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript Update project response
const url = 'https://api.phonic.ai/v1/projects/nameOrId';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update project response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.phonic.ai/v1/projects/nameOrId"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update project response
require 'uri'
require 'net/http'

url = URI("https://api.phonic.ai/v1/projects/nameOrId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'

response = http.request(request)
puts response.read_body
```

```java Update project response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.phonic.ai/v1/projects/nameOrId")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php Update project response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.phonic.ai/v1/projects/nameOrId', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Update project response
using RestSharp;

var client = new RestClient("https://api.phonic.ai/v1/projects/nameOrId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Update project response
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.phonic.ai/v1/projects/nameOrId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### projects_update_example

**Request**

```json
{
  "name": "updated-customer-support",
  "default_agent": "another-agent"
}
```

**Response**

```json
{
  "success": true
}
```

**SDK Code**

```python projects_update_example
import requests

url = "https://api.phonic.ai/v1/projects/nameOrId"

payload = {
    "name": "updated-customer-support",
    "default_agent": "another-agent"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript projects_update_example
const url = 'https://api.phonic.ai/v1/projects/nameOrId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"updated-customer-support","default_agent":"another-agent"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go projects_update_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.phonic.ai/v1/projects/nameOrId"

	payload := strings.NewReader("{\n  \"name\": \"updated-customer-support\",\n  \"default_agent\": \"another-agent\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby projects_update_example
require 'uri'
require 'net/http'

url = URI("https://api.phonic.ai/v1/projects/nameOrId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"updated-customer-support\",\n  \"default_agent\": \"another-agent\"\n}"

response = http.request(request)
puts response.read_body
```

```java projects_update_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.phonic.ai/v1/projects/nameOrId")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"updated-customer-support\",\n  \"default_agent\": \"another-agent\"\n}")
  .asString();
```

```php projects_update_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.phonic.ai/v1/projects/nameOrId', [
  'body' => '{
  "name": "updated-customer-support",
  "default_agent": "another-agent"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp projects_update_example
using RestSharp;

var client = new RestClient("https://api.phonic.ai/v1/projects/nameOrId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"updated-customer-support\",\n  \"default_agent\": \"another-agent\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift projects_update_example
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "updated-customer-support",
  "default_agent": "another-agent"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.phonic.ai/v1/projects/nameOrId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```