# createProjectResource

```graphql
mutation CreateProjectResource($input: CreateProjectResourceInput!) {
  createProjectResource(input: $input) {
    id
    pattern
    description
    title
    sourcePath
    source
    editMode
    sourceOnlyReasons
  }
}
```

Create a project resource, an MCP resource definition under resources/, in the project source or a preview branch; returns the project resource source document. Requires project.files.write.

## Arguments

| Name                     | Type                        | Required | Description |
| ------------------------ | --------------------------- | -------- | ----------- |
| `input`                  | CreateProjectResourceInput! | Yes      |             |
| `input.projectReference` | String                      |          |             |
| `input.sourceTargetKind` | String                      |          |             |
| `input.targetBranchId`   | ID                          |          |             |
| `input.id`               | String!                     | Yes      |             |
| `input.pattern`          | String!                     | Yes      |             |
| `input.description`      | String!                     | Yes      |             |
| `input.title`            | String                      |          |             |

## Variables

```json
{
  "input": {
    "id": "string",
    "pattern": "string",
    "description": "string"
  }
}
```

## Responses

| Status | Description                                                 |
| ------ | ----------------------------------------------------------- |
| 200    | The ProjectResourceDocument! in data.createProjectResource. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation CreateProjectResource($input: CreateProjectResourceInput!) {\n  createProjectResource(input: $input) {\n    id\n    pattern\n    description\n    title\n    sourcePath\n    source\n    editMode\n    sourceOnlyReasons\n  }\n}",
  "variables": {
    "input": {
      "id": "string",
      "pattern": "string",
      "description": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createProjectResource": {
      "id": "string",
      "pattern": "string",
      "description": "string",
      "title": "string",
      "sourcePath": "string",
      "source": "string",
      "editMode": "string",
      "sourceOnlyReasons": [
        "string"
      ]
    }
  }
}
```
