---
title: enable-or-disable-vercel-ci-for-a-connected-repository
product: vercel
url: /docs/rest-api/vercel-ci/enable-or-disable-vercel-ci-for-a-connected-repository
canonical_url: "https://vercel.com/docs/rest-api/vercel-ci/enable-or-disable-vercel-ci-for-a-connected-repository"
last_updated: 2026-10-09
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about enable-or-disable-vercel-ci-for-a-connected-repository on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Enable or disable Vercel CI for a connected repository

```http
PATCH /v1/vercel-ci/repository-settings
```

Update Repository Settings

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `provider` | string. enum: bitbucket, cursor-origin, github, gitlab, vercel | Yes |  |
| `organizationId` | string | Yes |  |
| `repository` | string | Yes |  |
| `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": [
    "ciEnabled"
  ],
  "properties": {
    "ciEnabled": {
      "type": "boolean"
    }
  }
}
```

## Example request

### TypeScript

```typescript
const response = await fetch('https://api.vercel.com/v1/vercel-ci/repository-settings?provider=string&organizationId=string&repository=string&teamId=string&slug=string', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "ciEnabled": "true"
  }),
});

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/vercel-ci/repository-settings?provider=string&organizationId=string&repository=string&teamId=string&slug=string', {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      "ciEnabled": "true"
    }),
    next: { revalidate: 3600 }
  });

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

  return response.json();
}
```

### cURL

```bash
curl -X PATCH 'https://api.vercel.com/v1/vercel-ci/repository-settings?provider=string&organizationId=string&repository=string&teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d "{
    \"ciEnabled\": \"true\"
  }"
```

## Example response

```json
{
  "provider": "example_id",
  "organizationId": "example_id",
  "repository": "string",
  "ciEnabled": "true",
  "ciEnabledAt": "123",
  "updatedAt": "123"
}
```

## Responses

### 200: Successfully updated the repository settings.

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "provider",
    "organizationId",
    "repository",
    "ciEnabled"
  ],
  "properties": {
    "provider": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string"
        },
        {
          "type": "string"
        },
        {
          "type": "string"
        },
        {
          "type": "string"
        }
      ]
    },
    "organizationId": {
      "type": "string"
    },
    "repository": {
      "type": "string"
    },
    "ciEnabled": {
      "type": "boolean"
    },
    "ciEnabledAt": {
      "type": "number"
    },
    "updatedAt": {
      "type": "number"
    }
  }
}
```

### 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.

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

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

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

### 404: No description

### 409: No description

### 410: No description

### 429: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "name",
        "message",
        "limit"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "limit": {
          "type": "number"
        }
      }
    }
  }
}
```

### 500: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

---

## Related

- [vercel-ci endpoints](/docs/rest-api#vercel-ci)

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

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

---

[View full sitemap](/docs/sitemap)
