---
title: "Upsert Subscription"
method: PUT
path: "/automated-notifications/subscriptions"
tags: ["Automated Notifications"]
---

# Upsert Subscription

`PUT /automated-notifications/subscriptions`

## Request

- Base URL: `https://api.talkdeskapp.com`
- URL: `https://api.talkdeskapp.com/automated-notifications/subscriptions`
- Auth: OAuth 2
  - Authorization code: `https://{account_name}.talkdeskid.com/oauth/authorize`
  - Token URL: `https://{account_name}.talkdeskid.com/oauth/token` scopes: `automated-notifications-subscriptions:write`

Subscribe or unsubscribe a topic or create a new subscription(subscribe)

## Request body

- object
  - `topic_id` string, required: The id of the topic to subscribe/unsubscribe.
  - `channel` object, required
    - `type` 'EMAIL' | 'SMS' | 'VOICE', required: The type of channel.
    - `uri` string, required: The channel uri (for instance email address or phone number).
  - `opt_in` boolean, required: The status of the subscription.

## Response `200`

OK

- object
  - `id` string, required: The id of the subscription.
  - `topic_id` string, required: The id of the topic to subscribe/unsubscribe.
  - `channel` object, required
    - `type` 'EMAIL' | 'SMS' | 'VOICE', required: The type of channel.
    - `uri` string, required: The channel uri (for instance email address or phone number).
  - `opt_in` boolean, required: The status of the subscription.
  - `_links` object, required
    - `self` object
      - `href` string, uri, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/talkdesk/apis/talkdesk.md) - [All operations](https://skmtc.dev/talkdesk/apis/talkdesk/llms.txt) - [OpenAPI document](https://skmtc.dev/talkdesk/apis/talkdesk/revisions/f69c52fd7456?raw)
