# Remove subscription from a contact

`DELETE /contacts/{contact_id}/subscriptions/{subscription_id}`

> This is a subset of the full specification, limited to the `DELETE /contacts/{contact_id}/subscriptions/{subscription_id}` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.18/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.18'
  description: This is a subset of the full specification, limited to the `DELETE /contacts/{contact_id}/subscriptions/{subscription_id}` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Contacts
    description: Everything about your contacts
  - name: Subscription Types
    description: Everything about subscription types
paths:
  /contacts/{contact_id}/subscriptions/{subscription_id}:
    delete:
      summary: Remove subscription from a contact
      tags:
        - Subscription Types
        - Contacts
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: contact_id
          in: path
          description: The unique identifier for the contact which is given by Intercom
          example: 63a07ddf05a32042dffac965
          required: true
          schema:
            type: string
        - name: subscription_id
          in: path
          description: The unique identifier for the subscription type which is given by Intercom
          example: '37846'
          required: true
          schema:
            type: string
      operationId: detachSubscriptionTypeToContact
      description: |
        You can remove a specific subscription from a contact. This will
        return a subscription type model for the subscription type that was removed
        from the contact.

        Requires the `read_write_users` or `write_users_companies` OAuth scope.
      responses:
        '200':
          description: Successful
          content:
            application/json:
              examples:
                Successful:
                  value:
                    type: subscription
                    id: '122'
                    state: live
                    consent_type: opt_in
                    default_translation:
                      name: Newsletters
                      description: Lorem ipsum dolor sit amet
                      locale: en
                    translations:
                      - name: Newsletters
                        description: Lorem ipsum dolor sit amet
                        locale: en
                    content_types:
                      - sms_message
              schema:
                $ref: '#/components/schemas/subscription_type'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: c7de741d-dc8f-49b1-8cbe-791668ade76c
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
                Token lacks required scope:
                  value:
                    type: error.list
                    request_id: 9c562afa-93d0-53d2-bfa4-bb6463fa84ee
                    errors:
                      - code: token_unauthorized
                        message: Not authorized to access resource
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Resource not found
          content:
            application/json:
              examples:
                Contact not found:
                  value:
                    type: error.list
                    request_id: 82b37940-b43f-46ee-a492-11543a317c97
                    errors:
                      - code: not_found
                        message: User Not Found
                Resource not found:
                  value:
                    type: error.list
                    request_id: c18422ca-5454-42af-9e1d-dd92066e6e9d
                    errors:
                      - code: not_found
                        message: Resource Not Found
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code.
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: '2.18'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
        - '2.16'
        - '2.17'
        - '2.18'
    subscription_type:
      title: Subscription Types
      type: object
      x-tags:
        - Subscription Types
      description: A subscription type lets customers easily opt out of non-essential communications without missing what's important to them.
      properties:
        type:
          type: string
          description: The type of the object - subscription
          example: subscription
        id:
          type: string
          description: The unique identifier representing the subscription type.
          example: '123456'
        state:
          type: string
          description: The state of the subscription type.
          enum:
            - live
            - draft
            - archived
          example: live
        default_translation:
          $ref: '#/components/schemas/translation'
        translations:
          type: array
          description: An array of translations objects with the localised version of the subscription type in each available locale within your translation settings.
          items:
            $ref: '#/components/schemas/translation'
        consent_type:
          type: string
          description: Describes the type of consent.
          enum:
            - opt_out
            - opt_in
          example: opt_in
        content_types:
          type: array
          description: The message types that this subscription supports - can contain `email` or `sms_message`.
          items:
            type: string
            enum:
              - email
              - sms_message
            example: email
    translation:
      title: Translation
      type: object
      description: A translation object contains the localised details of a subscription type.
      properties:
        name:
          type: string
          description: The localised name of the subscription type.
          example: Announcements
        description:
          type: string
          description: The localised description of the subscription type.
          example: Offers, product and feature announcements
        locale:
          type: string
          description: The two character identifier for the language of the translation object.
          example: en
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
