# Sessions

Source: https://swapcard.dev/content-api/examples/sessions


Create, list, update, link and delete the sessions of an event: talks, workshops, panels, roundtables, live streams, on-demand videos and more.

Sessions are `plannings` in the API: the object is `Planning`, and the operations on this page are `importEventPlannings`, `planningsV2`, `upsertPlanningRedirectUrlView`, `createEventPlanningLink` and `deleteEventPlannings`.

Reference: [`Planning` object](../graphql-event-api-schema/objects/planning.mdx)

On this page you can:

- [Create a session](#create-a-session)
- [Create sessions with different formats](#create-session-with-different-formats)
- [Add a redirection button to a session](#create-redirection-on-a-session)
- [List, filter and sort sessions](#list-sessions)
- [Get the attendees of a session](#get-the-sessions-attendees)
- [Update a session](#update-session)
- [Link two sessions](#link-two-sessions)
- [Delete sessions](#delete-sessions)

## Before you begin

- An API key, sent in the `Authorization` header. The key acts with the roles and permissions of the user who created it. See [Authentication](/organizer/authentication).
- The ID of the event, for mutations (`eventId`). See [Events](./graphql-event-api-examples-event.md).
- The ID of the community, for the `planningsV2` list queries (`communityId`).

<a id="create-basic-planningsession"></a>

## Create a session
Use the `importEventPlannings` mutation to create one or more sessions in an event. Each entry of `plannings` has an `inputId`, a `clientId` and a `create` object with the session data. The response returns each created session in `results` and each failure in `errors`, both with the `inputId` you sent.

| Argument | Description |
| --- | --- |
| `eventId` | The ID of the event where you create the sessions. |
| `clientId` | Your own unique ID for this session. |
| `titleTranslations` | The name of the session in each language. |
| `descriptionTranslations` | The description of the session in each language. |
| `beginsAt` | Start date and time of the session. |
| `endsAt` | End date and time of the session. |

:::note
To set custom fields when you create a session, use `fields`. When you [update a session](#update-session), use `customFields`.
:::

```graphql title="Mutation"
mutation importEventPlannings($eventId: ID!, $plannings: [ImportEventPlanningInput!]!) {
    importEventPlannings(eventId: $eventId, plannings: $plannings) {
      results {
        inputId
        planning {
          id
          title
          description
        }
      }
      errors {
        inputId
        message
        errorCode
      }
    }
  }
```

```json title="Variables"
{
   "eventId":"RXZlbnRfMTcyMjY0",
   "plannings":[
      {
         "inputId":"0",
         "clientId": "9876543210",
         "create":{
            "titleTranslations":[
               {
                  "value":"in person",
                  "language":"en_US"
               },
               {
                  "value":"salut",
                  "language":"fr_FR"
               }
            ],
            "descriptionTranslations":[
               {
                  "value":"<p>eng</p>",
                  "language":"en_US"
               },
               {
                  "value":"<p>fr</p>",
                  "language":"fr_FR"
               }
            ],
            "isRatable":false,
            "bannerUrl":null,
            "beginsAt":"2027-07-01T06:00:00.000Z",
            "endsAt":"2027-07-01T07:00:00.000Z",
            "canRegister":{
               "enabled":true,
               "eventGroupsCanRegister":[
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDA="
                  },
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDE="
                  },
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDI="
                  },
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDM="
                  }
               ]
            },
            "communityProfileCanRegister":false,
            "hideAttendees":false,
            "isOverlappingAllowed":true,
            "isPrivate":false,
            "maxSeats":50,
            "hashtag":"#event-2027",
            "liveStream":null,
            "preRecorded":null,
            "onDemand":null,
            "roundtable":null,
            "accessControlMode":"TRACKING",
            "fields":[
               {
                  "definitionId":"RmllbGREZWZpbml0aW9uXzI4NDU5NQ==",
                  "value":"25",
                  "locale":"en_US",
                  "selectOptionKey":null
               },
               {
                  "definitionId":"RmllbGREZWZpbml0aW9uXzI4NDU5Ng==",
                  "value":"long text",
                  "locale":"en_US",
                  "selectOptionKey":null
               }
            ],
            "exhibitors":[
               "RXhoaWJpdG9yXzEwOTAyNQ==",
               "RXhoaWJpdG9yXzExMDYxOA=="
            ]
         }
      },
      {
         "inputId":"1",
         "clientId": "5876543219",
         "create":{
            "titleTranslations":[
               {
                  "value":"roundtable",
                  "language":"en_US"
               },
               {
                  "value":"salut",
                  "language":"fr_FR"
               }
            ],
            "descriptionTranslations":[
               {
                  "value":"<p>eng</p>",
                  "language":"en_US"
               },
               {
                  "value":"<p>fr</p>",
                  "language":"fr_FR"
               }
            ],
            "isRatable":false,
            "bannerUrl":null,
            "beginsAt":"2027-07-01T06:00:00.000Z",
            "endsAt":"2027-07-01T07:00:00.000Z",
            "canRegister":{
               "enabled":true,
               "eventGroupsCanRegister":[
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDA="
                  },
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDE="
                  },
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDI="
                  },
                  {
                     "enabled":true,
                     "eventGroupId":"RXZlbnRHcm91cF8yNzM1MDM="
                  }
               ]
            },
            "communityProfileCanRegister":false,
            "hideAttendees":false,
            "isOverlappingAllowed":true,
            "isPrivate":false,
            "maxSeats":50,
            "hashtag":"#event-2027",
            "liveStream":null,
            "preRecorded":null,
            "onDemand":null,
            "roundtable":{
               "starts":"2027-07-01 09:00:00",
               "ends":"2027-07-01 10:00:00"
            },
            "accessControlMode":"TRACKING",
            "exhibitors":[
               "RXhoaWJpdG9yXzEwOTAyNQ=="
            ]
         }
      }
   ]
}
```

## Create sessions with different formats
Use the same `importEventPlannings` mutation to create sessions with a format. Formats mostly add video properties to a session.

| Argument | Description |
| --- | --- |
| `eventId` | The ID of the event where you create the sessions. |
| `clientId` | Your own unique ID for this session. |
| `titleTranslations` | The name of the session in each language. |
| `beginsAt` | Start date and time of the session. |
| `endsAt` | End date and time of the session. |

A session has one of five formats:

| Format | Description |
| --- | --- |
| `PHYSICAL` | A session without video: `liveStream`, `onDemand`, `preRecorded` and `roundtable` are empty. Suited to in-person events. |
| `LIVE_STREAM` | Plays the webinar in real time from a supported live streaming provider. The stream comes from a third-party tool or from Backstage: set `isBackstage` to `true` or `false` accordingly. |
| `ON_DEMAND` | A video, linked or uploaded, that is available at any time. The session dates are hidden. |
| `PRE_RECORDED` | A pre-recorded video, played at the scheduled time. |
| `ROUNDTABLE` | A meeting room that participants can join. |

The variables below create seven sessions: four live streams (third-party, YouTube, Vimeo and Backstage), a roundtable, an in-person session and a pre-recorded session.

```graphql title="Mutation"
mutation ImportEventPlannings($eventId: ID!, $plannings: [ImportEventPlanningInput!]!) {
  importEventPlannings(eventId: $eventId, plannings: $plannings) {
    results {
      inputId
      planning {
        id
        title
        description
        bannerUrl
        beginsAt
        endsAt
        isVideoHiddenToGuest
        isVideoHiddenToCommunityLevel
        videoRestrictedEventGroups {
          id
          name
        }
        onDemand {
          video {
            __typename
            ... on YoutubeEmbeddedVideo {
              ...PlanningFormat_YoutubeVideoFragment
            }
            ... on VimeoEmbeddedVideo {
              ...PlanningFormat_VimeoVideoFragment
            }
            ... on IframeEmbeddedVideo {
              ...PlanningFormat_IframeVideoFragment
            }
            ... on UploadedFileEmbeddedVideo {
              ...PlanningFormat_UploadedFileVideoFragment
            }
          }
        }
        liveStream {
          availableAt
          availableUntil
          isRecorded
          stream {
            __typename
            ... on YoutubeEmbeddedVideo {
              ...PlanningFormat_YoutubeVideoFragment
            }
            ... on VimeoEmbeddedVideo {
              ...PlanningFormat_VimeoVideoFragment
            }
            ... on IframeEmbeddedVideo {
              ...PlanningFormat_IframeVideoFragment
            }
            ...Backstage_RTMPLiveStreamVideoFragment
          }
        }
        preRecorded {
          availableAt
          availableUntil
        }
        fields {
          ...FieldValueFragment
        }
        roundtable {
          starts
          ends
        }
      }
    }
    errors {
      inputId
      message
      errorCode
    }
  }
}

fragment PlanningFormat_YoutubeVideoFragment on YoutubeEmbeddedVideo {
  videoId
}

fragment PlanningFormat_VimeoVideoFragment on VimeoEmbeddedVideo {
  videoId
}

fragment PlanningFormat_IframeVideoFragment on IframeEmbeddedVideo {
  iframeSource
}

fragment PlanningFormat_UploadedFileVideoFragment on UploadedFileEmbeddedVideo {
  uploadedVideoId
  isSimulatedLive
}

fragment Backstage_RTMPLiveStreamVideoFragment on RTMPLiveStreamVideo {
  activeSource
  backstage {
    moderatorCommunityProfile {
      id
      firstName
      lastName
      photoUrl
      jobTitle
      organization
    }
  }
}
```

```json title="Variables"
{
  "eventId": "RXZlbnRfNTUxMDI0",
  "plannings": [
    {
      "inputId": "1",
      "clientId": "9876543210",
      "create": {
        "titleTranslations": [
          {
            "value": "3rd party",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "<p>description</p>",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": false,
        "bannerUrl": null,
        "beginsAt": "2027-07-01T09:00:00.000Z",
        "endsAt": "2027-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": 50,
        "hashtag": "2025-09-15T14:42:22.665Z",
        "liveStream": {
          "availableAt": "2027-07-01T09:00:00.000Z",
          "availableUntil": null,
          "stream": {
            "iframe": null,
            "vimeo": null,
            "youtube": null,
            "rtmp": {
            }
          },
          "isBackstage": false
        },
        "preRecorded": null,
        "onDemand": null,
        "roundtable": null,
        "isVideoHiddenToGuest": true,
        "isVideoHiddenToCommunityLevel": false,
        "restrictedEventGroupIds": [],
        "accessControlMode": "TRACKING"
      }
    },
    {
      "inputId": "2",
      "clientId": "4876543216",
      "create": {
        "titleTranslations": [
          {
            "value": "embedded",
            "language": "en_US"
          },
          {
            "value": "embedded",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "<p>description</p>",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": false,
        "bannerUrl": null,
        "beginsAt": "2027-07-01T09:00:00.000Z",
        "endsAt": "2027-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": 101,
        "hashtag": "2025-09-15T14:42:22.665Z",
        "liveStream": {
          "availableAt": "2027-07-01T09:00:00.000Z",
          "availableUntil": null,
          "stream": {
            "iframe": null,
            "vimeo": null,
            "youtube": {
              "videoId": "https://www.youtube.com/"
            },
            "rtmp": null
          }
        },
        "preRecorded": null,
        "onDemand": null,
        "roundtable": null,
        "accessControlMode": "TRACKING"
      }
    },
    {
      "inputId": "4",
      "clientId": "3876543217",
      "create": {
        "titleTranslations": [
          {
            "value": "Backstage",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": false,
        "bannerUrl": null,
        "beginsAt": "2027-07-01T09:00:00.000Z",
        "endsAt": "2027-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": null,
        "hashtag": "2025-09-15T14:42:22.668Z",
        "liveStream": {
          "availableAt": "2027-07-01T09:00:00.000Z",
          "availableUntil": null,
          "stream": {
            "iframe": null,
            "vimeo": null,
            "youtube": null,
            "rtmp": {
            }
          },
          "isBackstage": true
        },
        "preRecorded": null,
        "onDemand": null,
        "roundtable": null,
        "accessControlMode": "TRACKING"
      }
    },
    {
      "inputId": "5",
      "clientId": "6876743316",
      "create": {
        "titleTranslations": [
          {
            "value": "Roundtable",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": true,
        "bannerUrl": null,
        "beginsAt": "2025-07-01T09:00:00.000Z",
        "endsAt": "2025-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": null,
        "hashtag": "2025-09-15T14:42:22.668Z",
        "liveStream": null,
        "preRecorded": null,
        "onDemand": null,
        "roundtable": {
          "starts": "2025-07-01T09:00:00.000Z",
          "ends": "2025-07-01T10:00:00.000Z",
          "audioOnly": false,
          "moderatedStage": false
        },
        "accessControlMode": "TRACKING"
      }
    },
    {
      "inputId": "6",
      "clientId": "8876343321",
      "create": {
        "titleTranslations": [
          {
            "value": "In person",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": false,
        "bannerUrl": null,
        "beginsAt": "2027-07-01T09:00:00.000Z",
        "endsAt": "2027-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": null,
        "hashtag": "2025-09-15T14:42:22.669Z",
        "liveStream": null,
        "preRecorded": null,
        "onDemand": null,
        "roundtable": null,
        "accessControlMode": "TRACKING"
      }
    },
    {
      "inputId": "7",
      "clientId": "2874345326",
      "create": {
        "titleTranslations": [
          {
            "value": "pre-recorded",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": false,
        "bannerUrl": null,
        "beginsAt": "2027-07-01T09:00:00.000Z",
        "endsAt": "2027-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": null,
        "hashtag": "2025-09-15T14:42:22.669Z",
        "liveStream": null,
        "preRecorded": {
          "availableAt": "2027-07-01T09:00:00.000Z",
          "availableUntil": null,
          "video": {
            "iframe": null,
            "vimeo": null,
            "youtube": null,
            "rtmp": null
          }
        },
        "onDemand": null,
        "roundtable": null,
        "accessControlMode": "TRACKING"
      }
    },
    {
      "inputId": "9",
      "clientId": "1834345526",
      "create": {
        "titleTranslations": [
          {
            "value": "embedded-live",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "descriptionTranslations": [
          {
            "value": "",
            "language": "en_US"
          },
          {
            "value": "",
            "language": "fr_FR"
          }
        ],
        "isRatable": false,
        "bannerUrl": null,
        "beginsAt": "2027-07-01T09:00:00.000Z",
        "endsAt": "2027-07-01T10:00:00.000Z",
        "communityProfileCanRegister": false,
        "hideAttendees": false,
        "isOverlappingAllowed": true,
        "isPrivate": false,
        "maxSeats": null,
        "hashtag": "2025-09-15T14:42:22.669Z",
        "liveStream": {
          "availableAt": "2027-07-01T09:00:00.000Z",
          "availableUntil": null,
          "stream": {
            "iframe": null,
            "vimeo": {
              "videoId": "https://vimeo.com"
            },
            "youtube": null,
            "rtmp": null
          }
        },
        "preRecorded": null,
        "onDemand": null,
        "roundtable": null,
        "accessControlMode": "TRACKING"
      }
    }
  ]
}
```

## Add a redirection button to a session
Use the `upsertPlanningRedirectUrlView` mutation to display a button on a session that redirects attendees to a URL.

| Argument | Description |
| --- | --- |
| `name` | The label of the button displayed on the session. |
| `planningId` | The ID of the session that gets the button. |
| `redirectUrl` | The URL the button opens. |

The example also sets `translations`, `backgroundColor` and `iconUrl`.

```graphql title="Mutation"
mutation upsertPlanningRedirectUrlView($input: UpsertPlanningRedirectUrlViewInput!){
  upsertPlanningRedirectUrlView(input: $input) {
    planning {
      id
      titleTranslations {
        value
        language
      }
      beginsAt
      endsAt
    }
  }
}
```

```json title="Variables"
{ "input": {
  "name":"Redirect Button",
  "planningId": "UGxhbm5pbmdfODAxNzYz",
  "redirectUrl": "https://www.test.redirect.com/",
  "translations": {"language": "en_US", "name": "Redirect Button", "redirectUrl": "https://www.test.redirect.com/"},
  "backgroundColor": "#EA204F",
  "iconUrl": "https://cdn-api.swapcard.com/public/pictos/link.png"
  }
}
```

## List sessions

Use the `planningsV2` query to list the sessions of a community. Every example below uses the same query: only the variables change. Combine `filter`, `sort`, `search` and `cursor` as needed.

### Get the first 100 sessions
Fetch the first page of sessions for one or more events.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community. |
| `eventIds` | Array of event IDs to search in. |
| `cursor` | Pagination. `first` sets how many records to fetch per page. On the first request, omit `after` or set it to `null`. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
	"communityId": "Q29tbXVuaXR5XzY2NjQ=",
	"filter": {
		"eventIds": [
			"RXZlbnRfMTcxMzA5"
		]
	},
	"cursor": {
		"first": 100
	}
}
```

### Get the next 100 sessions
To fetch the next page, send the same query and set `cursor.after` to the `pageInfo.endCursor` value of the previous response. Repeat while `pageInfo.hasNextPage` is `true`.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community. |
| `eventIds` | Array of event IDs to search in. |
| `cursor` | Pagination. `first` sets how many records to fetch per page; `after` is the cursor returned by the previous response. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
	"communityId": "Q29tbXVuaXR5XzY2NjQ=",
	"filter": {
		"eventIds": [
			"RXZlbnRfMTcxMzA5"
		]
	},
	"cursor": {
		"first": 100,
    "after": "INSERT_CURSOR_ID_HERE"  
	}
}
```

### Get sessions by ID
Fetch specific sessions of an event.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `eventIds` | The IDs of the events to search in. |
| `ids` | Array of session IDs to fetch. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
	"communityId": "Q29tbXVuaXR5XzY2NjQ=",
	"filter": {
		"eventIds": [
			"RXZlbnRfMTcxMzA5"
		],
		"ids": [
			"UGxhbm5pbmdfMTc1Njcz"
		]
	}
}
```

### Filter by event
Fetch the sessions of a community that belong to specific events.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `eventIds` | Array of event IDs (`ID`). |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
    "eventIds": ["INSERT_EVENT_IDS_HERE"]
  }
}
```

### Filter by client ID
Fetch sessions by the `clientId` values you set when you created them.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `clientIds` | Array of client IDs (`ID`). |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
    "clientIds": ["INSERT_CLIENT_IDS_HERE"]
  }
}
```

### Filter by speaker
Fetch the sessions of specific speakers.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `speakerIds` | Array of speaker IDs (`ID`). |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
    "speakerIds": ["INSERT_SPEAKER_IDS_HERE"]
  }
}
```

### Filter by place
Fetch the sessions that take place in specific places.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `placeIds` | Array of place IDs (`ID`). |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
    "placeIds": ["INSERT_PLACE_IDS_HERE"]
  }
}
```

### Filter by session ID
Fetch specific sessions of a community by their IDs.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `ids` | Array of session (planning) IDs (`ID`). |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
    "ids": ["INSERT_PLANNING_IDS_HERE"]
  }
}
```

### Sort sessions
Sort the results by one or more fields. `sort` is an array: the example sorts by start date, then by creation date.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `field` | The field to sort by: `BEGINS_AT`, `BOOKMARKED_SINCE`, `CREATED_AT`, `DESCRIPTION`, `ENDS_AT`, `PLACE`, `TITLE`, `TOTAL_ATTENDEES`, `TOTAL_CATEGORIES`, `TOTAL_DOCUMENTS`, `TOTAL_EXHIBITORS`, `TOTAL_SPEAKERS`, `TOTAL_SCAN_IN`, `TOTAL_SCAN_OUT` or `TYPE`. |
| `order` | The sort order: `ASC` or `DESC`. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "sort": [
    {
      "field": "BEGINS_AT",
      "order": "ASC"
    },
    {
      "field": "CREATED_AT",
      "order": "ASC"
    }
  ]
}
```

### Filter by bookmark
Fetch only the sessions that are bookmarked, or only those that are not.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `isBookmarked` | `true` or `false`: whether the session is bookmarked. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
    "isBookmarked": true
  }
}
```

### Filter by format
Fetch the sessions of one or more [formats](#create-session-with-different-formats).

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `formats` | Array of formats: `ON_DEMAND`, `LIVE_STREAM`, `PRE_RECORDED`, `PHYSICAL` or `ROUNDTABLE`. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "filter": {
   "formats": [
    "ON_DEMAND",
    "LIVE_STREAM"
   ]
  }
}
```

### Search sessions by title
Find sessions whose title matches a search string.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `search` | The string to search for in session titles. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  events {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      id
			title
    }
  }
  format
  clientIds
  description
  isPrivate
  isRatable
  exhibitors {
    id
  }
  speakers {
    id
  }
  attendees(page: 1, pageSize: 10) {
    id
  }
  fields {
    __typename
    ... on SelectField {
      id
      value
    }
  }
}
```

```json title="Variables"
{
  "communityId": "Q29tbXVuaXR5XzE=",
  "search": "INSERT_PLANNING_TITLE_HERE"
}
```

## Get the attendees of a session
Use the `planningsV2` query with the `attendees` field to fetch the attendees of a session.

| Argument | Description |
| --- | --- |
| `communityId` | The ID of the community to search in. |
| `eventIds` | The IDs of the events to search in. |
| `ids` | The IDs of the sessions. |

```graphql title="Query"
query Planningsv2(
  $communityId: ID!
  $search: String
  $cursor: CursorPaginationInput
  $filter: EventPlanningFilterInput
  $sort: [PlanningSortType!]
) {
  planningsV2(
    communityId: $communityId
    search: $search
    filter: $filter
    sort: $sort
    cursor: $cursor
  ) {
    pageInfo {
      endCursor
      hasNextPage
    }
    totalCount
    nodes {
      ...Planning
    }
  }
}

fragment Planning on Planning {
  id
  place
  title
  totalAttendees
  type
  attendees(page: 1, pageSize: 10) {
    id
		firstName
		lastName
		jobTitle
		organization
  }
  
}
```

```json title="Variables"
{
	"communityId": "Q29tbXVuaXR5XzY2NjQ=",
	"filter": {
		"eventIds": [
			"RXZlbnRfMTcyMjY0"
		],
		"ids": [
			"UGxhbm5pbmdfMTc2OTgw"
		]
	}
}
```

## Update a session
Use the `importEventPlannings` mutation with an `id` and an `update` object to change an existing session.

| Argument | Description |
| --- | --- |
| `eventId` | The ID of the event that contains the session. |
| `id` | The ID of the session to update. |
| `titleTranslations` | The name of the session in each language. |
| `beginsAt` | Start date and time of the session. |
| `endsAt` | End date and time of the session. |

:::note
To update custom fields, use `customFields`. When you [create a session](#create-a-session), use `fields`.
:::

```graphql title="Mutation"
mutation ImportEventPlannings($eventId: ID!, $plannings: [ImportEventPlanningInput!]!) {
  importEventPlannings(eventId: $eventId, plannings: $plannings) {
    results {
      inputId
      planning {
        id
        title
        description
        bannerUrl
        beginsAt
        endsAt
        isVideoHiddenToGuest
        isVideoHiddenToCommunityLevel
        videoRestrictedEventGroups {
          id
          name
        }
        onDemand {
          video {
            __typename
            ... on YoutubeEmbeddedVideo {
              ...PlanningFormat_YoutubeVideoFragment
            }
            ... on VimeoEmbeddedVideo {
              ...PlanningFormat_VimeoVideoFragment
            }
            ... on IframeEmbeddedVideo {
              ...PlanningFormat_IframeVideoFragment
            }
            ... on UploadedFileEmbeddedVideo {
              ...PlanningFormat_UploadedFileVideoFragment
            }
          }
        }
        liveStream {
          availableAt
          availableUntil
          isRecorded
          stream {
            __typename
            ... on YoutubeEmbeddedVideo {
              ...PlanningFormat_YoutubeVideoFragment
            }
            ... on VimeoEmbeddedVideo {
              ...PlanningFormat_VimeoVideoFragment
            }
            ... on IframeEmbeddedVideo {
              ...PlanningFormat_IframeVideoFragment
            }
            ...Backstage_RTMPLiveStreamVideoFragment
          }
        }
        preRecorded {
          availableAt
          availableUntil
        }
        roundtable {
          starts
          ends
        }
      }
    }
    errors {
      inputId
      message
      errorCode
    }
  }
}

fragment PlanningFormat_YoutubeVideoFragment on YoutubeEmbeddedVideo {
  videoId
}

fragment PlanningFormat_VimeoVideoFragment on VimeoEmbeddedVideo {
  videoId
}

fragment PlanningFormat_IframeVideoFragment on IframeEmbeddedVideo {
  iframeSource
}

fragment PlanningFormat_UploadedFileVideoFragment on UploadedFileEmbeddedVideo {
  uploadedVideoId
  isSimulatedLive
}

fragment Backstage_RTMPLiveStreamVideoFragment on RTMPLiveStreamVideo {
  activeSource
  backstage {
    moderatorCommunityProfile {
      id
      firstName
      lastName
      photoUrl
      jobTitle
      organization
    }
  }
}
```

```json title="Variables"
{
	"eventId": "RXZlbnRfMTcyMjY0",
	"plannings": {
		"id": "UGxhbm5pbmdfMTc2OTgw",
		"update": {
			"titleTranslations": [
				{
					"value": "update planning",
					"language": "en_US"
				},
				{
					"value": "salut",
					"language": "fr_FR"
				}
			],
			"descriptionTranslations": [
				{
					"value": "<p>eng</p>",
					"language": "en_US"
				},
				{
					"value": "<p>fr</p>",
					"language": "fr_FR"
				}
			],
			"isRatable": false,
			"bannerUrl": null,
			"beginsAt": "2027-07-01T06:00:00.000Z",
			"endsAt": "2027-07-01T07:00:00.000Z",
			"canRegister": {
				"enabled": true,
				"eventGroupsCanRegister": [
					{
						"enabled": true,
						"eventGroupId": "RXZlbnRHcm91cF8yNzM1MDA="
					},
					{
						"enabled": true,
						"eventGroupId": "RXZlbnRHcm91cF8yNzM1MDE="
					},
					{
						"enabled": true,
						"eventGroupId": "RXZlbnRHcm91cF8yNzM1MDI="
					},
					{
						"enabled": true,
						"eventGroupId": "RXZlbnRHcm91cF8yNzM1MDM="
					}
				]
			},
			"communityProfileCanRegister": false,
			"hideAttendees": false,
			"isOverlappingAllowed": true,
			"isPrivate": false,
			"maxSeats": 50,
			"hashtag": "#event-2027",
			"liveStream": {
				"availableAt": "2027-07-01T06:00:00.000Z",
				"availableUntil": null,
				"stream": {
					"iframe": null,
					"vimeo": null,
					"youtube": null,
					"rtmp": {}
				},
				"isBackstage": true
			},
			"preRecorded": null,
			"onDemand": null,
			"roundtable": null,
			"isVideoHiddenToGuest": false,
			"isVideoHiddenToCommunityLevel": true,
			"restrictedEventGroupIds": ["RXZlbnRHcm91cF8yNzM1MDA="],
			"accessControlMode": "TRACKING",
			"customFields": [
				{
					"definitionId": "RmllbGREZWZpbml0aW9uXzI4MzcwNw==",
					"choices": {
						"keys": []
					}
				},
				{
					"definitionId": "RmllbGREZWZpbml0aW9uXzI4MzcwOA==",
					"choices": {
						"keys": []
					}
				},
				{
					"definitionId": "RmllbGREZWZpbml0aW9uXzI4NDM1NQ==",
					"text": {
						"value": null,
						"language": "fr_FR"
					}
				},
				{
					"definitionId": "RmllbGREZWZpbml0aW9uXzI4NDU5NQ==",
					"number": null
				}
			],
			"exhibitors": {
				"action": "REMOVE",
				"ids": [
					"RXhoaWJpdG9yXzEwOTAyNQ=="
				]
			}
		}
	}
}
```

## Link two sessions
Link an existing session to another session of the same event. This takes two mutations: the first defines the relation, the second links the two sessions in the UI.

### Step 1: Create a session link

Use the `createEventPlanningLink` mutation to create a link that defines the relation between the two sessions (the parent and child names).

```graphql title="Mutation"
mutation CreateEventPlanningLink($data: CreatePlanningLinkInput!, $eventId: String!) {
  createEventPlanningLink(data: $data, eventId: $eventId) {
    eventId
    id
    parentName {
      language
      value
    }
    childName {
      language
      value
    }
  }
}
```

```json title="Variables"
{
  "eventId":"RXZlbnRfNDY1Njc4",
  "data": {
   "childName": {"language": "en_US", "value": "Bakery World Cup"},
   "parentName":{"language": "en_US", "value": "Coupe de France des Ecoles"}
  }  
}
```

The response contains an `id`: this is the planning link ID you use in step 2.

### Step 2: Link the sessions

Use the `importEventPlannings` mutation to add the link to the parent session. Pass the planning link ID as `linkId`, and the IDs of the parent and child sessions.

```graphql title="Mutation"
mutation LinkedSessions(
    $eventId: ID!
    $linkId: ID!
    $parentPlanningId: ID!
    $childPlanningId: ID!
  ) {
    importEventPlannings(
      eventId: $eventId
      plannings: [
        {
          id: $parentPlanningId
          update: {
            linkedPlannings: {
              action: ADD
              links: [{ linkId: $linkId, planningId: $childPlanningId }]
            }
          }
        }
      ]
    ) {
      results {
        planning {
          id
          ...LinkedSessionsFragment
        }
      }
      errors {
        message
      }
    }
  }
  fragment LinkedSessionsFragment on Planning {
    planningsByPlanningLink {
      link {
        ...PlanningLinksFragment
      }
      plannings {
        id
        title
        beginsAt
        endsAt
        format
        liveStream {
          availableAt
        }
      }
      linkRelation
    }
  }
  fragment PlanningLinksFragment on PlanningLink {
    id
    eventId
    parentName {
      language
      value
    }
    childName {
      language
      value
    }
  }
```

```json title="Variables"
{
  "eventId": "RXZlbnRfMTcyMjY0",
  "linkId": "UGxhbm5pbmdMaW5rXzExMjk=",
  "parentPlanningId": "UGxhbm5pbmdfMTc2OTQ5",
  "childPlanningId": "UGxhbm5pbmdfMTc2OTM1"
}
```

## Delete sessions
Use the `deleteEventPlannings` mutation to delete one or more sessions from an event.

| Argument | Description |
| --- | --- |
| `eventId` | The ID of the event that contains the sessions. |
| `planningsIds` | Array of the IDs of the sessions to delete. |

```graphql title="Mutation"
mutation deletePlannings($eventId: String!, $planningsIds: [String!]!) {
  deleteEventPlannings(eventId: $eventId, planningsIds: $planningsIds) {
    id
    titleTranslations {
        value
        language
    }
    beginsAt
    endsAt
  }
}
```

```json title="Variables"
{
 "eventId": "RXZlbnRfMQ==",  
  "planningsIds": [
   "UGxhbm5pbmdfODAxNzUz","UGxhbm5pbmdfODAxNzU0"
  ]
}
```
