# Add subscription to a contact

You can add a specific subscription to a contact. In Intercom, we have two different subscription types based on user consent - opt-out and opt-in:

  1.Attaching a contact to an opt-out subscription type will opt that user out from receiving messages related to that subscription type.

  2.Attaching a contact to an opt-in subscription type will opt that user in to receiving messages related to that subscription type.

This will return a subscription type model for the subscription type that was added to the contact.

Endpoint: POST /contacts/{contact_id}/subscriptions
Version: 2.7
Security: bearerAuth

## Path parameters:

  - `contact_id` (string, required)
    The unique identifier for the contact which is given by Intercom

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `id` (string, required)
    The unique identifier for the subscription which is given by Intercom
    Example: 37846

  - `consent_type` (string, required)
    The consent_type of a subscription, opt_out or opt_in.
    Example: opt_in

## Response 200 fields (application/json):

  - `type` (string)
    The type of the object - subscription
    Example: subscription

  - `id` (string)
    The unique identifier representing the subscription type.
    Example: 123456

  - `state` (string)
    The state of the subscription type.
    Enum: "live", "draft", "archived"

  - `default_translation` (object)
    A translation object contains the localised details of a subscription type.

  - `default_translation.name` (string)
    The localised name of the subscription type.
    Example: Announcements

  - `default_translation.description` (string)
    The localised description of the subscription type.
    Example: Offers, product and feature announcements

  - `default_translation.locale` (string)
    The two character identifier for the language of the translation object.
    Example: en

  - `translations` (array)
    An array of translations objects with the localised version of the subscription type in each available locale within your translation settings.

  - `consent_type` (string)
    Describes the type of consent.
    Enum: "opt_out", "opt_in"

  - `content_types` (array)
    The message types that this subscription supports - can contain `email` or `sms_message`.

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 404 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

