> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Project Dependencies

> Manage project dependencies

Projects can depend on other projects, allowing you to share components and content types across projects. This page covers all dependency management operations.

## List Dependencies

<div className="mb-4">
  <span className="bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm font-medium">GET</span>
  <code className="ml-2">/app/v1/organizations/{organizationId}/projects/{projectId}/dependencies</code>
</div>

### Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

### Response

```json theme={null}
{
  "data": [
    {
      "projectId": "proj456",
      "name": "UI Components",
      "version": "2.0.0"
    }
  ]
}
```

***

## Add Dependency

<div className="mb-4">
  <span className="bg-green-100 text-green-800 px-2 py-1 rounded text-sm font-medium">POST</span>
  <code className="ml-2">/app/v1/organizations/{organizationId}/projects/{projectId}/dependencies</code>
</div>

### Request Body

<ParamField body="projectId" type="string" required>
  ID of the project to depend on
</ParamField>

<ParamField body="version" type="string" required>
  Semantic version of the dependency (e.g., "2.0.0")
</ParamField>

### Example Request

```json theme={null}
{
  "projectId": "proj456",
  "version": "2.0.0"
}
```

### Response

Returns the updated Project object with the new dependency added.

### Error Responses

#### Dependent Project Not Found

```json theme={null}
{
  "error": {
    "code": "DEPENDENT_PROJECT_NOT_FOUND",
    "message": "Dependent project not found"
  }
}
```

#### Circular Dependency

```json theme={null}
{
  "error": {
    "code": "CIRCULAR_DEPENDENCY",
    "message": "Adding this dependency would create a circular dependency"
  }
}
```

***

## Remove Dependency

<div className="mb-4">
  <span className="bg-red-100 text-red-800 px-2 py-1 rounded text-sm font-medium">DELETE</span>
  <code className="ml-2">/app/v1/organizations/{organizationId}/projects/{projectId}/dependencies/{dependentProjectId}</code>
</div>

### Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="dependentProjectId" type="string" required>
  ID of the dependent project to remove
</ParamField>

### Response

Returns the updated Project object with the dependency removed.

***

## Code Examples

<CodeGroup>
  ```bash cURL - List theme={null}
  curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj123/dependencies" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```bash cURL - Add theme={null}
  curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj123/dependencies" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "projectId": "proj456",
      "version": "2.0.0"
    }'
  ```

  ```bash cURL - Remove theme={null}
  curl -X DELETE "https://api.metabind.ai/app/v1/organizations/org123/projects/proj123/dependencies/proj456" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  // List dependencies
  const listResponse = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj123/dependencies',
    {
      headers: { 'Authorization': 'Bearer YOUR_JWT' }
    }
  );
  const { data: dependencies } = await listResponse.json();

  // Add dependency
  const addResponse = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj123/dependencies',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        projectId: 'proj456',
        version: '2.0.0'
      })
    }
  );

  // Remove dependency
  const removeResponse = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj123/dependencies/proj456',
    {
      method: 'DELETE',
      headers: { 'Authorization': 'Bearer YOUR_JWT' }
    }
  );
  ```
</CodeGroup>
