# Connect Sessions

## The ConnectSession object

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `connectSession`. |
| `id` | string | Yes | Unique identifier for the Connect Session. |
| `appearance` | object | Yes |  |
| `callbackUrl` | string,null | Yes | The URL to which the user will be redirected after the Connect Session is completed. |
| `intent` | object | Yes |  |
| `url` | string,null | Yes | The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user. |
| `user` | string,null | Yes | The unique identifier of the user that the session is for. |

---

## Create a connect session

`POST /projects/{project}/connectSessions`

Creates a new Connect Session for the given parameters.

Related guide: [Connect Sessions](https://developers.gigs.com/docs/connect/connect-sessions/about)

> **Info**
> #### Preview
> 
>  This endpoint is currently in preview and might change in the future.
> 
>  We’re excited to hear your feedback and ideas. Please send an email
>  to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

### Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `appearance` | object | No |  |
| `callbackUrl` | string,null | No | The URL to which the user will be redirected after the Connect Session is completed. |
| `intent` | object | Yes |  |
| `user` | string,null | No | The unique identifier of the user. |
| `userDetails` | object | No |  |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project` | string | Yes | The unique identifier for the [project](https://developers.gigs.com/core/projects#the-project-resource). |

### Responses

#### 201 — Returns the newly created Connect Session.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `connectSession`. |
| `id` | string | Yes | Unique identifier for the Connect Session. |
| `appearance` | object | Yes |  |
| `callbackUrl` | string,null | Yes | The URL to which the user will be redirected after the Connect Session is completed. |
| `intent` | object | Yes |  |
| `url` | string,null | Yes | The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user. |
| `user` | string,null | Yes | The unique identifier of the user that the session is for. |

#### 403 — The authenticated user doesn't have permissions to perform the request.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

#### 422 — The request can't be processed, often due to an invalid parameter or incompatible system state.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

---

## Retrieve a connect session

`GET /projects/{project}/connectSessions/{connectSessionId}`

Retrieves the details of an existing Connect Session.

> **Info**
> #### Preview
> 
>  This endpoint is currently in preview and might change in the future.
> 
>  We’re excited to hear your feedback and ideas. Please send an email
>  to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project` | string | Yes | The unique identifier for the [project](https://developers.gigs.com/core/projects#the-project-resource). |
| `connectSessionId` | string | Yes |  |

### Responses

#### 200 — Returns the Connect Session if it exists.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `connectSession`. |
| `id` | string | Yes | Unique identifier for the Connect Session. |
| `appearance` | object | Yes |  |
| `callbackUrl` | string,null | Yes | The URL to which the user will be redirected after the Connect Session is completed. |
| `intent` | object | Yes |  |
| `url` | string,null | Yes | The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user. |
| `user` | string,null | Yes | The unique identifier of the user that the session is for. |

#### 403 — The authenticated user doesn't have permissions to perform the request.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

#### 404 — The requested resource doesn't exist.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

---

## Update a connect session

`PATCH /projects/{project}/connectSessions/{connectSessionId}`

Updates the Connect Session with the given parameters.

The `user` or `userDetails` attributes can only be set when the session is not associated with a user yet.

Related guide: [Connect Sessions](https://developers.gigs.com/docs/connect/connect-sessions/about)

> **Info**
> #### Preview
> 
>  This endpoint is currently in preview and might change in the future.
> 
>  We’re excited to hear your feedback and ideas. Please send an email
>  to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.

### Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `appearance` | object | No |  |
| `callbackUrl` | string,null | No | The URL to which the user will be redirected after the Connect Session is completed. |
| `user` | string,null | No | The unique identifier of the user. |
| `userDetails` | object | No |  |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project` | string | Yes | The unique identifier for the [project](https://developers.gigs.com/core/projects#the-project-resource). |
| `connectSessionId` | string | Yes |  |

### Responses

#### 200 — Returns the updated Connect Session.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `connectSession`. |
| `id` | string | Yes | Unique identifier for the Connect Session. |
| `appearance` | object | Yes |  |
| `callbackUrl` | string,null | Yes | The URL to which the user will be redirected after the Connect Session is completed. |
| `intent` | object | Yes |  |
| `url` | string,null | Yes | The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user. |
| `user` | string,null | Yes | The unique identifier of the user that the session is for. |

#### 403 — The authenticated user doesn't have permissions to perform the request.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

#### 404 — The requested resource doesn't exist.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

#### 422 — The request can't be processed, often due to an invalid parameter or incompatible system state.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | string | Yes | Type of object is always `error`. |
| `code` | string | No | An optional machine-readable description of the error. Present for errors that could be handled programmatically. |
| `details` | object[] | No | Optional array containing specific information for the current error.  <!-- theme: info --> > #### Preview > > This property is currently in preview and might change in the future. > > We’re excited to hear your feedback and ideas. Please send an email > to [support@gigs.com](mailto:support@gigs.com) to share your thoughts.  |
| `documentation` | string[] | No | An optional list of URLs providing further information to resolve the error. |
| `hint` | string | No | An optional explanation how to resolve the error. |
| `message` | string | Yes | A human readable description of the error. |
| `type` | string | Yes | The type of [error](https://developers.gigs.com/api/error-handling) returned. |

---
