# Subscriptions

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing Subscriptions in the platform.**

## Queries

### Query Subscriptions

[fetch SDL for query subscriptions](#graphql-partial-sdls).

### Get Subscription

[fetch SDL for query subscription](#graphql-partial-sdls).

## Mutations

### Create Subscription

[fetch SDL for mutation createSubscription](#graphql-partial-sdls).

### Update Subscription

[fetch SDL for mutation updateSubscription](#graphql-partial-sdls).

### Delete Subscription

[fetch SDL for mutation deleteSubscription](#graphql-partial-sdls).

## Output types

### CommercetoolsSubscription

> This type is equivalent to [Subscription](/search.md?urn=ctp:api:type:Subscription) in REST.

[fetch SDL for type CommercetoolsSubscription](#graphql-partial-sdls).

### CommercetoolsSubscriptionQueryResult

[fetch SDL for type CommercetoolsSubscriptionQueryResult](#graphql-partial-sdls).

#### ChangeSubscription

[fetch SDL for type ChangeSubscription](#graphql-partial-sdls).

#### EventSubscription

[fetch SDL for type EventSubscription](#graphql-partial-sdls).

#### MessageSubscription

> In GraphQL, `resourceTypeId` is a `String`, not an enum. For [MessageSubscription](/search.md?urn=ctp:api:type:MessageSubscription), it accepts the values listed in [MessageSubscriptionResourceTypeId](/search.md?urn=ctp:api:type:MessageSubscriptionResourceTypeId). The same applies to [ChangeSubscription](/search.md?urn=ctp:api:type:ChangeSubscription) with [ChangeSubscriptionResourceTypeId](/search.md?urn=ctp:api:type:ChangeSubscriptionResourceTypeId), and to [EventSubscription](/search.md?urn=ctp:api:type:EventSubscription) with [EventSubscriptionResourceTypeId](/search.md?urn=ctp:api:type:EventSubscriptionResourceTypeId).

[fetch SDL for type MessageSubscription](#graphql-partial-sdls).

#### SubscriptionHealthStatus

[fetch SDL for type SubscriptionHealthStatus](#graphql-partial-sdls).

#### AwsAuthenticationMode

[fetch SDL for type AwsAuthenticationMode](#graphql-partial-sdls).

#### Destination

[fetch SDL for type Destination](#graphql-partial-sdls).

#### SQSDestination

[fetch SDL for type SQSDestination](#graphql-partial-sdls).

#### SNSDestination

[fetch SDL for type SNSDestination](#graphql-partial-sdls).

#### EventBridgeDestination

[fetch SDL for type EventBridgeDestination](#graphql-partial-sdls).

#### AzureServiceBusDestination

[fetch SDL for type AzureServiceBusDestination](#graphql-partial-sdls).

#### GoogleCloudPubSubDestination

[fetch SDL for type GoogleCloudPubSubDestination](#graphql-partial-sdls).

#### ConfluentCloudDestination

[fetch SDL for type ConfluentCloudDestination](#graphql-partial-sdls).

#### EventGridDestination

[fetch SDL for type EventGridDestination](#graphql-partial-sdls).

#### NotificationFormat

[fetch SDL for type NotificationFormat](#graphql-partial-sdls).

#### PlatformFormat

[fetch SDL for type PlatformFormat](#graphql-partial-sdls).

#### CloudEventsSubscriptionsFormat

[fetch SDL for type CloudEventsSubscriptionsFormat](#graphql-partial-sdls).

## Input types

### SubscriptionDraft

[fetch SDL for type SubscriptionDraft](#graphql-partial-sdls).

#### ChangeSubscriptionInput

[fetch SDL for type ChangeSubscriptionInput](#graphql-partial-sdls).

#### EventSubscriptionInput

[fetch SDL for type EventSubscriptionInput](#graphql-partial-sdls).

#### MessageSubscriptionInput

[fetch SDL for type MessageSubscriptionInput](#graphql-partial-sdls).

#### DestinationInput

> REST identifies the destination with a `type` field. In GraphQL, the input has one field per destination type instead: `SQS`, `SNS`, `AzureServiceBus`, `EventGrid`, `GoogleCloudPubSub`, `EventBridge`, and `ConfluentCloud`. These names match the `type` values of [Destination](/search.md?urn=ctp:api:type:Destination) in REST. The deprecated `IronMQ` destination isn't available in GraphQL.

[fetch SDL for type DestinationInput](#graphql-partial-sdls).

#### SQSDestinationInput

[fetch SDL for type SQSDestinationInput](#graphql-partial-sdls).

#### SNSDestinationInput

[fetch SDL for type SNSDestinationInput](#graphql-partial-sdls).

#### EventBridgeDestinationInput

[fetch SDL for type EventBridgeDestinationInput](#graphql-partial-sdls).

#### AzureServiceBusDestinationInput

[fetch SDL for type AzureServiceBusDestinationInput](#graphql-partial-sdls).

#### GoogleCloudPubSubDestinationInput

[fetch SDL for type GoogleCloudPubSubDestinationInput](#graphql-partial-sdls).

#### ConfluentCloudDestinationInput

[fetch SDL for type ConfluentCloudDestinationInput](#graphql-partial-sdls).

#### EventGridDestinationInput

[fetch SDL for type EventGridDestinationInput](#graphql-partial-sdls).

#### SubscriptionFormatInput

[fetch SDL for type SubscriptionFormatInput](#graphql-partial-sdls).

#### PlatformFormatInput

[fetch SDL for type PlatformFormatInput](#graphql-partial-sdls).

#### CloudEventsSubscriptionsFormatInput

[fetch SDL for type CloudEventsSubscriptionsFormatInput](#graphql-partial-sdls).

### SubscriptionUpdateAction

[fetch SDL for type SubscriptionUpdateAction](#graphql-partial-sdls).

### Update actions

#### Change Destination

[fetch SDL for type ChangeSubscriptionDestination](#graphql-partial-sdls).

#### Set Changes

[fetch SDL for type SetSubscriptionChanges](#graphql-partial-sdls).

#### Set Events

[fetch SDL for type SetSubscriptionEvents](#graphql-partial-sdls).

#### Set Key

[fetch SDL for type SetSubscriptionKey](#graphql-partial-sdls).

#### Set Messages

[fetch SDL for type SetSubscriptionMessages](#graphql-partial-sdls).

## Related pages

- [Area overview page with navigation](/api.md)
- [Previous page: REST](/api/projects/subscriptions.md)
- [Search documentation and API specs](/search.md)