# 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.
Requires the `read_write_users` or `write_users_companies` OAuth scope.

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

## Security:

  - `bearerAuth` (unknown)
    http bearer

## 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)
    Ignored. Whether the contact is opted in or out is decided by the subscription type's own `consent_type`, not by this value.
    Example: opt_in

## Request examples:

  - `Successful` (unknown)

  - `Contact not found` (unknown)

  - `Resource not found` (unknown)

## Response 200:

  - `200` (unknown)
    Successful

## 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:

  - `401` (unknown)
    Unauthorized

## 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.data` (object)
    Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
    Example: {"required_permissions":["read_conversations"]}

## Response 404:

  - `404` (unknown)
    Resource not found

## 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.data` (object)
    Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
    Example: {"required_permissions":["read_conversations"]}

## Response 200 examples:

  - `Successful` (unknown)

## Response 401 examples:

  - `Unauthorized` (unknown)

  - `Token lacks required scope` (unknown)

## Response 404 examples:

  - `Contact not found` (unknown)

  - `Resource not found` (unknown)

