---
title: "Update a subscription"
method: PUT
path: "/v1/projects/{projectID}/subscriptions/{subscriptionID}"
tags: ["Subscriptions"]
---

# Update a subscription

`PUT /v1/projects/{projectID}/subscriptions/{subscriptionID}`

This endpoint updates a subscription

## Path parameters

- `projectID` string, required
- `subscriptionID` string, required

## Request body

- ModelsUpdateSubscription
  - `alert_config` ModelsAlertConfiguration
    - `count` integer — Count
    - `threshold` string — Threshold
  - `app_id` string — Deprecated but necessary for backward compatibility
  - `endpoint_id` string — Destination endpoint ID
  - `filter_config` ModelsFilterConfiguration
    - `event_types` string[] — List of event types that the subscription should match
    - `filter` ModelsFS
      - `body` DatastoreM
      - `headers` DatastoreM
  - `function` string — Convoy supports mutating your request payload using a js function. Use this field to specify a `transform` function for this purpose. See this[https://docs.getconvoy.io/product-manual/subscriptions#functions] for more
  - `name` string — Subscription Nme
  - `rate_limit_config` ModelsRateLimitConfiguration
    - `count` integer
    - `duration` integer
  - `retry_config` ModelsRetryConfiguration
    - `duration` string — Used to specify a valid Go time duration e.g 10s, 1h3m for how long to wait between event delivery retries
    - `interval_seconds` integer — Used to specify a time in seconds for how long to wait between event delivery retries,
    - `retry_count` integer — Used to specify the max number of retries
    - `type` 'linear' | 'exponential'
  - `source_id` string — Source Id

## Response `200`

OK

- object
  - `message` string
  - `status` boolean
  - `data` ModelsSubscriptionResponse
    - `alert_config` DatastoreAlertConfiguration
      - `count` integer
      - `threshold` string
    - `created_at` string
    - `deleted_at` string
    - `device_metadata` DatastoreDevice
      - `created_at` string
      - `deleted_at` string
      - `endpoint_id` string
      - `host_name` string
      - `last_seen_at` string
      - `project_id` string
      - `status` 'offline' | 'online' | 'disabled'
      - `uid` string
      - `updated_at` string
    - `endpoint_metadata` DatastoreEndpoint
      - `advanced_signatures` boolean
      - `authentication` DatastoreEndpointAuthentication
        - `api_key` DatastoreApiKey
          - `header_name` string
          - `header_value` string
        - `type` 'api_key'
      - `created_at` string
      - `deleted_at` string
      - `description` string
      - `events` integer
      - `http_timeout` integer
      - `name` string
      - `owner_id` string
      - `project_id` string
      - `rate_limit` integer
      - `rate_limit_duration` integer
      - `secrets` DatastoreSecret[]
        - `created_at` string
        - `deleted_at` string
        - `expires_at` string
        - `uid` string
        - `updated_at` string
        - `value` string
      - `slack_webhook_url` string
      - `status` 'active' | 'inactive' | 'pending' | 'paused'
      - `support_email` string
      - `uid` string
      - `updated_at` string
      - `url` string
    - `filter_config` DatastoreFilterConfiguration
      - `event_types` string[]
      - `filter` DatastoreFilterSchema
        - `body` DatastoreM
        - `headers` DatastoreM
        - `is_flattened` boolean
    - `function` NullString
      - `string` string
      - `valid` boolean — Valid is true if String is not NULL
    - `name` string
    - `rate_limit_config` DatastoreRateLimitConfiguration
      - `count` integer
      - `duration` integer
    - `retry_config` DatastoreRetryConfiguration
      - `duration` integer
      - `retry_count` integer
      - `type` 'linear' | 'exponential'
    - `source_metadata` DatastoreSource
      - `body_function` string
      - `created_at` string
      - `custom_response` DatastoreCustomResponse
        - `body` string
        - `content_type` string
      - `deleted_at` string
      - `forward_headers` string[]
      - `header_function` string
      - `idempotency_keys` string[]
      - `is_disabled` boolean
      - `mask_id` string
      - `name` string
      - `project_id` string
      - `provider` 'github' | 'twitter' | 'shopify'
      - `provider_config` DatastoreProviderConfig
        - `twitter` DatastoreTwitterProviderConfig
          - `crc_verified_at` string
      - `pub_sub` DatastorePubSubConfig
        - `amqp` DatastoreAmqpPubSubConfig
          - `auth` DatastoreAmqpCredentials
            - `password` string
            - `user` string
          - `bindedExchange` string
          - `deadLetterExchange` string
          - `host` string
          - `port` string
          - `queue` string
          - `routingKey` string
          - `schema` string
          - `vhost` string
        - `google` DatastoreGooglePubSubConfig
          - `project_id` string
          - `service_account` integer[]
          - `subscription_id` string
        - `kafka` DatastoreKafkaPubSubConfig
          - `auth` DatastoreKafkaAuth
            - `hash` string
            - `password` string
            - `tls` boolean
            - `type` string
            - `username` string
          - `brokers` string[]
          - `consumer_group_id` string
          - `topic_name` string
        - `sqs` DatastoreSQSPubSubConfig
          - `access_key_id` string
          - `default_region` string
          - `queue_name` string
          - `secret_key` string
        - `type` 'sqs' | 'google' | 'kafka' | 'amqp'
        - `workers` integer
      - `type` 'http' | 'rest_api' | 'pub_sub' | 'db_change_stream'
      - `uid` string
      - `updated_at` string
      - `url` string
      - `verifier` DatastoreVerifierConfig
        - `api_key` DatastoreApiKey
          - `header_name` string
          - `header_value` string
        - `basic_auth` DatastoreBasicAuth
          - `password` string
          - `username` string
        - `hmac` DatastoreHMac
          - `encoding` 'base64' | 'hex'
          - `hash` string
          - `header` string
          - `secret` string
        - `type` 'noop' | 'hmac' | 'basic_auth' | 'api_key'
    - `type` 'cli' | 'api'
    - `uid` string
    - `updated_at` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found

## Changes

- **2024-03-26** `2ddfad646792` — 1 info
  - api operation id `UpdateSubscription` was added
- **2024-01-30** `5a219dba9f40` — 1 breaking, 2 info
  - removed the success response with the status `202`
  - api operation id `UpdateSubscription` removed and replaced with ``
  - added the success response with the status `200`

[Change history](https://skmtc.dev/frain-dev/apis/convoy-api-reference/changes/v1/projects/:projectID/subscriptions/:subscriptionID/put.md)

---

[API](https://skmtc.dev/frain-dev/apis/convoy-api-reference.md) · [All operations](https://skmtc.dev/frain-dev/apis/convoy-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/frain-dev/convoy-api-reference/revisions/831c5f3ca19d/schema)
