# Edit

`PATCH /workspaces/:workspace/projects/:project_name`

Update project configuration

**Required Scopes:** `WORKSPACE`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The human-readable ID of the project */
  project_name: string; // Example: "my-project"
}
```

## Body Parameters

```typescript
interface BodyParameters {
  /** The human-readable ID of the project */
  name?: string;
  /** The Name of the project */
  display_name?: string;
  /** The status of the project */
  status?: "ACTIVE" | "CLOSED";
  /** Indicates if this is a public project */
  access?: "PRIVATE" | "PUBLIC";
  /** Defines whether the submodules are fetched during the runs in this project */
  fetch_submodules?: boolean;
  /** Name of the key that will be used to authorize while fetching the submodules. Required when `fetch_submodules` is set to `true` */
  fetch_submodules_env_key?: string;
  /** Enables/disables pull requests in the project. Available only for projects synchronized with GitHub or GitHub Enterprise repository */
  allow_pull_requests?: boolean;
  /** If set to true, the default branch will be updated from GitHub/GitLab/Bitbucket. */
  update_default_branch_from_external?: boolean;
}
```

## Response Body

```typescript
interface ResponseBody {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The human-readable ID of the project */
  name?: string;
  /** The Name of the project */
  display_name: string;
  /** The status of the project */
  status?: string;
  /** Indicates if this is a public project */
  access?: "PRIVATE" | "PUBLIC";
  /** The creation date of the project */
  create_date?: string;
  /** Repo slug of the Bitbucket, GitHub or GitLab project. Required when adding the integrated project */
  external_project_id?: string;
  /** ID of the project in GitLab */
  git_lab_project_id?: number;
  /** SSH or HTTPS url of the git repository. Required when adding the project integrated with custom git repository */
  custom_repo_url?: string;
  /** Username used to authorize access to the git repository. Required when adding the project integrated with custom git repository */
  custom_repo_user?: string;
  /** Password used to authorize access to the git repository. Required when adding the project integrated with custom git repository and the provided `custom_repo_url` is the HTTPS url */
  custom_repo_pass?: string;
  /** The ID of the private SSH key used to authorize access to the git repository. Required when adding the project integrated with private git server by SSH url */
  custom_repo_ssh_key_id?: number;
  /** User/member reference */
  created_by?: MemberView;
  /** The HTTP repository URL */
  http_repository?: string;
  /** The SSH repository URL */
  ssh_repository?: string;
  /** The default branch name */
  default_branch?: string;
  /** Integration reference */
  integration?: IntegrationIdView;
  /** Defines whether the submodules are fetched during the runs in this project */
  fetch_submodules?: boolean;
  /** Name of the key that will be used to authorize while fetching the submodules. Required when `fetch_submodules` is set to `true` */
  fetch_submodules_env_key?: string;
  /** Enables/disables pull requests in the project. Available only for projects synchronized with GitHub or GitHub Enterprise repository */
  allow_pull_requests?: boolean;
  /** If set to true, the default branch will be updated from GitHub/GitLab/Bitbucket. */
  update_default_branch_from_external?: boolean;
  /** If set to true, the project is created without any repository attached. */
  without_repository?: boolean;
}
```

## Type Definitions

```typescript
interface MemberView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the user */
  id?: number;
  /** The name of the user */
  name?: string;
  /** The avatar URL of the user */
  avatar_url?: string;
  /** The email address of the user */
  email?: string;
  /** Whether the user has admin privileges */
  admin?: boolean;
  /** Whether the user is workspace owner */
  workspace_owner?: boolean;
}

interface IntegrationIdView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** A human-readable ID of the integration */
  identifier?: string;
  /** The unique hash ID of the integration */
  hash_id?: string;
  /** The name of the integration */
  name?: string;
  /** The type of integration */
  type?: "GIT_HUB" | "BITBUCKET" | "GOOGLE" | "DIGITAL_OCEAN" | "SLACK" | "MODULUS" | "HEROKU" | "AMAZON" | "GIT_LAB" | "SHOPIFY" | "GIT_HUB_ENTERPRISE" | "GIT_LAB_ENTERPRISE" | "PUSHOVER" | "PUSHBULLET" | "RACKSPACE" | "CUSTOM" | "CLOUDFLARE" | "NEW_RELIC" | "SENTRY" | "ROLLBAR" | "DATADOG" | "DO_SPACES" | "HONEYBADGER" | "VULTR" | "SENTRY_ENTERPRISE" | "LOGGLY" | "HIP_CHAT" | "FIREBASE" | "TELEGRAM" | "AZURE" | "UPCLOUD" | "GHOST_INSPECTOR" | "NETLIFY" | "AZURE_CLOUD" | "MICROSOFT_TEAMS" | "GOOGLE_SERVICE_ACCOUNT" | "GOOGLE_PLAY_STORE" | "DOCKER_HUB" | "APP_STORE" | "GIT_HUB_APP" | "GIT_HUB_APP_ENTERPRISE" | "GIT_HUB_API" | "ATOP" | "SNYK" | "STACK_HAWK" | "BLACKFIRE" | "BACKBLAZE" | "ONE_LOGIN" | "OKTA" | "CONTENTFUL" | "JIRA";
  /** The authentication method used by the integration */
  auth_type?: "OAUTH" | "TOKEN" | "API_KEY" | "APP" | "APP_SPRYKER" | "TOKEN_APP_EXTENSION" | "DEFAULT" | "OIDC" | "TRUSTED" | "APP_RW";
  /** The host URL for custom integrations */
  host_url?: string;
  /** The webhook URL for receiving notifications */
  webhook_address?: string;
  /** The ATOP service URL */
  atop_url?: string;
  /** The application ID for Azure Cloud integrations */
  app_id?: string;
  /** The Google Cloud project ID */
  google_project?: string;
  /** The JWT audience for token validation */
  audience?: string;
}

```

## Request Example

```bash
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/projects/:project_name" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "updated-landing-page",
  "display_name": "Updated Landing Page",
  "status": "ACTIVE",
  "access": "PUBLIC",
  "fetch_submodules": false,
  "fetch_submodules_env_key": "updated_key",
  "allow_pull_requests": false,
  "update_default_branch_from_external": true
}'
```

## Response Example

**Status:** `200 OK`

```json
{
  "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project",
  "html_url": "https://app.buddy.works/my-workspace/projects/my-project",
  "name": "my-project",
  "display_name": "My Project",
  "external_project_id": null,
  "gitlab_project_id": null,
  "custom_repo_url": null,
  "custom_repo_user": null,
  "custom_repo_pass": null,
  "custom_repo_ssh_key_id": null,
  "status": "ACTIVE",
  "access": "PRIVATE",
  "create_date": "2023-01-15T10:30:00Z",
  "created_by": {
    "url": "https://api.buddy.works/workspaces/my-workspace/members/123",
    "html_url": "https://app.buddy.works/my-workspace/profile/123",
    "id": 123,
    "name": "John Doe",
    "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/123/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/w/32/32/AVATAR.png?ts=1674644200000",
    "email": "john.doe@company.com",
    "admin": false,
    "workspace_owner": false
  },
  "http_repository": "https://git.buddy.works/my-workspace/my-project.git",
  "ssh_repository": "git@git.buddy.works:my-workspace/my-project.git",
  "default_branch": "main",
  "integration": null,
  "fetch_submodules": true,
  "fetch_submodules_env_key": "id_workspace",
  "allow_pull_requests": true,
  "update_default_branch_from_external": false,
  "without_repository": false
}
```

---
Original source: https://buddy.works/docs/api/platform/projects/edit