# createProjectInvitation

```graphql
mutation CreateProjectInvitation($projectReference: ID!, $input: CreateProjectInvitationInput!) {
  createProjectInvitation(projectReference: $projectReference, input: $input) {
    outcome
    invitation {
      id
      projectId
      email
      role
      createdAt
    }
    userId
    emailSent
  }
}
```

Create an invitation. Requires project.invites.manage.

## Arguments

| Name               | Type                          | Required | Description                                   |
| ------------------ | ----------------------------- | -------- | --------------------------------------------- |
| `projectReference` | ID!                           | Yes      | Project UUID or slug.                         |
| `input`            | CreateProjectInvitationInput! | Yes      |                                               |
| `input.email`      | String!                       | Yes      | Email address to invite; stored in lowercase. |
| `input.role`       | ProjectInvitationRole!        | Yes      | One of `admin`, `editor`, `viewer`.           |

## Variables

```json
{
  "projectReference": "string",
  "input": {
    "email": "user@example.com",
    "role": "admin"
  }
}
```

## Responses

| Status | Description                                                   |
| ------ | ------------------------------------------------------------- |
| 200    | The ProjectInvitationResult! in data.createProjectInvitation. |

## 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 CreateProjectInvitation($projectReference: ID!, $input: CreateProjectInvitationInput!) {\n  createProjectInvitation(projectReference: $projectReference, input: $input) {\n    outcome\n    invitation {\n      id\n      projectId\n      email\n      role\n      createdAt\n    }\n    userId\n    emailSent\n  }\n}",
  "variables": {
    "projectReference": "string",
    "input": {
      "email": "user@example.com",
      "role": "admin"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createProjectInvitation": {
      "outcome": "member_added",
      "invitation": {
        "id": "string",
        "projectId": "string",
        "email": "user@example.com",
        "role": "admin",
        "createdAt": "2026-01-01T00:00:00Z"
      },
      "userId": "string",
      "emailSent": false
    }
  }
}
```
