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

# Create connect session

> Create connect session.

`createConnectSession(projectReference: ID!, name: String!, input: CreateConnectSessionInput!): ConnectSession!`

## Arguments

| Argument | Type | Required | Description |
| - | - | - | - |
| `projectReference` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Yes | Project ID or slug. A missing or inaccessible project, including a denied scope-dependent project access check, returns not\_found. |
| `name` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Integration name, for example github. |
| `input` | [`CreateConnectSessionInput!`](https://veryfront.com/docs/cloud/graphql/types/createconnectsessioninput) | Yes | |

## Input fields

### input

[`CreateConnectSessionInput`](https://veryfront.com/docs/cloud/graphql/types/createconnectsessioninput)

| Field | Type | Required | Description |
| - | - | - | - |
| `scope` | [`ConnectionScope!`](https://veryfront.com/docs/cloud/graphql/types/connectionscope) | Yes | Connection owner. Project scope needs the editor role; user scope connects your own account and needs viewer access to the project. API keys also need the integrations write scope. Verified user-session or API-key credentials are required; MCP OAuth grants and runtime credentials are refused. |
| `redirectUri` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Trusted web or native URI the browser returns to after consent. |

## Response

Returns [`ConnectSession!`](https://veryfront.com/docs/cloud/graphql/types/connectsession). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `sessionToken` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | One-time connect session token, embedded in connectUrl. |
| `connectUrl` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | URL to open in a browser; it starts provider consent through GET /oauth/connect/\{integration}. |
| `expiresAt` | [`DateTime!`](https://veryfront.com/docs/cloud/graphql/types/datetime) | Time after which connectUrl no longer starts consent. |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation CreateConnectSession($projectReference: ID!, $name: String!, $input: CreateConnectSessionInput!) {
  createConnectSession(projectReference: $projectReference, name: $name, input: $input) {
    connectUrl
    expiresAt
    sessionToken
  }
}
```

```json title="variables.json" theme={null}
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "name": "github",
  "input": {
    "scope": "user",
    "redirectUri": "veryfront://auth/integrations"
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.