The intercom API reference.
Home//
REST API Reference
/- Remove subscription from a contact
Contact
List attached contacts
Attach a Contact to a Company
List attached companies for contact
Detach a contact from a company
List all notes
Create a note
List attached segments for contact
List subscriptions for a contact
Add subscription to a contact
List tags attached to a contact
Add tag to a contact
Remove tag from a contact
Update a contact
Get a contact
Delete a contact
Merge a lead and a user
Search contacts
List all contacts
Create contact
Archive contact
Unarchive contact
Remove subscription from...
Intercom API (2.10)
Download OpenAPI description
Overview
URL
License
Languages
Servers
The production API server
https://api.intercom.io/
The european API server
https://api.eu.intercom.io/
The australian API server
https://api.au.intercom.io/
Request
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.
Security
bearerAuth
The unique identifier for the subscription which is given by Intercom
Example: "37846"
- The production API serverhttps://api.intercom.io/contacts/{contact_id}/subscriptions
- The european API serverhttps://api.eu.intercom.io/contacts/{contact_id}/subscriptions
- The australian API serverhttps://api.au.intercom.io/contacts/{contact_id}/subscriptions
- curl
- Node.js
- Ruby
- PHP
- Python
- Java
- Go
- C#
- R
curl -i -X POST \
https://api.intercom.io/contacts/63a07ddf05a32042dffac965/subscriptions \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'Intercom-Version: 2.10' \
-d '{
"id": 154,
"consent_type": "opt_in"
}'Response
application/json
{ "type": "subscription", "id": "154", "state": "live", "consent_type": "opt_in", "default_translation": { "name": "Newsletters", "description": "Lorem ipsum dolor sit amet", "locale": "en" }, "translations": [ { … } ], "content_types": [ "sms_message" ] }
- The production API serverhttps://api.intercom.io/contacts/{contact_id}/subscriptions/{id}
- The european API serverhttps://api.eu.intercom.io/contacts/{contact_id}/subscriptions/{id}
- The australian API serverhttps://api.au.intercom.io/contacts/{contact_id}/subscriptions/{id}
- curl
- Node.js
- Ruby
- PHP
- Python
- Java
- Go
- C#
- R
curl -i -X DELETE \
https://api.intercom.io/contacts/63a07ddf05a32042dffac965/subscriptions/37846 \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Intercom-Version: 2.10'Response
application/json
{ "type": "subscription", "id": "170", "state": "live", "consent_type": "opt_in", "default_translation": { "name": "Newsletters", "description": "Lorem ipsum dolor sit amet", "locale": "en" }, "translations": [ { … } ], "content_types": [ "sms_message" ] }