---
title: connect-a-project-to-the-flags-of-this-project
product: vercel
url: /docs/rest-api/feature-flags/connect-a-project-to-the-flags-of-this-project
canonical_url: "https://vercel.com/docs/rest-api/feature-flags/connect-a-project-to-the-flags-of-this-project"
last_updated: 2026-11-02
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about connect-a-project-to-the-flags-of-this-project on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Connect a project to the flags of this project

```http
PUT /v1/projects/{projectIdOrName}/feature-flags/connections
```

Connects a project in the same team to the flags of this project. The consumer project reads this project's flags with its own deployment identity by naming this project in the Flags SDK. Connections grant read and evaluate access across environments, with the consumer deployment's environment selecting the source environment. Requires connection management permission on the source project and read access to the consumer project.

## Authentication

**bearerToken**: HTTP bearer

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `projectIdOrName` | string | Yes | The project id or name |


## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Request body

Required: No

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "consumerProjectId"
  ],
  "properties": {
    "consumerProjectId": {
      "type": "string",
      "description": "The project in the same team that may read the flags of this project"
    }
  }
}
```

## Example request

### TypeScript

```typescript
const response = await fetch('https://api.vercel.com/v1/projects/projectIdOrName/feature-flags/connections?teamId=string&slug=string', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "consumerProjectId": "example_id"
  }),
});

const data = await response.json();
console.log(data);
```

### Next.js

```typescript
'use server';

export async function callEndpoint() {
  const response = await fetch('https://api.vercel.com/v1/projects/projectIdOrName/feature-flags/connections?teamId=string&slug=string', {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      "consumerProjectId": "example_id"
    }),
    next: { revalidate: 3600 }
  });

  if (!response.ok) {
    throw new Error('Request failed');
  }

  return response.json();
}
```

### cURL

```bash
curl -X PUT 'https://api.vercel.com/v1/projects/projectIdOrName/feature-flags/connections?teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d "{
    \"consumerProjectId\": \"example_id\"
  }"
```

## Example response

```json
{
  "consumerProjectId": "example_id",
  "consumerProjectName": "Example Name",
  "createdAt": "123",
  "createdBy": "string",
  "sourceProjectId": "example_id",
  "sourceProjectName": "Example Name"
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "consumerProjectId",
    "consumerProjectName",
    "createdAt",
    "createdBy",
    "sourceProjectId",
    "sourceProjectName"
  ],
  "properties": {
    "consumerProjectId": {
      "type": "string"
    },
    "consumerProjectName": {
      "type": "string"
    },
    "createdAt": {
      "type": "number"
    },
    "createdBy": {
      "type": "string"
    },
    "sourceProjectId": {
      "type": "string"
    },
    "sourceProjectName": {
      "type": "string"
    }
  }
}
```

### 400: One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.

### 401: The request is not authorized.

### 402: The account is missing a payment so payment method must be updated

### 403: You do not have permission to access this resource.

### 404: No description

### 409: No description

### 410: No description

### 503: No description

---

## Related

- [feature-flags endpoints](/docs/rest-api#feature-flags)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://vercel.com/openapi.json) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
