REST API v4
The REST API allows you to retrieve and update the data that is stored inside Copernica from out of your own website or app. You can write your own scripts that send requests and instructions to our servers to fetch this data or to update it. You can use this API to automatically synchronize the data in Copernica with your own system, without any human interference. This page contains an overview of all API calls.
We are currently on version 4 of the REST API. This article explains the new version (and how to switch) in full detail. Not ready to switch? If you want to use previous versions of the API, here is a link to the v3 documentation.
Method types
There are four types of methods:
- GET: Used to fetch data
- POST: Used to create new data
- PUT: Used to overwrite existing data
- DELETE: Used to delete data
See the introduction for more information about HTTP requests.
Overview
Use the links below to jump to the type of API call you are looking for.
- Account
- Databases & Collections
- Views & Miniviews
- Rules & Minirules
- Profiles & Subprofiles
- HTML Mailings
- Drag and drop mailings
- Datarequests
- Logfiles
- Sender domains
Account
In the table below you can find a call to retrieve account information.
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/identity | Fetch the account information |
GET | api.copernica.com/v4/consumption | Fetch the account consumption |
Databases & Collections
You can search and maintain your databases and collections with API calls. The following table contains the calls related to database and collection structure.
Databases
Collections
Import
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/imports | Import data in the account |
GET | api.copernica.com/v4/import/$id | Fetch information about an import |
Views & Miniviews
Views are selections under a database, while miniviews are selections under a collection. You can find methods that relate to a specific (mini)view below.
View
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/database/$id/views | Create a view |
POST | api.copernica.com/v4/view/$id/copy | Copy a view |
GET | api.copernica.com/v4/view/$id | Fetch the view information |
PUT | api.copernica.com/v4/view/$id | Update the view information |
DELETE | api.copernica.com/v4/view/$id | Delete a view |
GET | api.copernica.com/v4/view/$id/views | Fetch all nested views |
POST | api.copernica.com/v4/view/$id/views | Create a nested view |
GET | api.copernica.com/v4/view/$id/profileids | Fetch all view profile IDs |
GET | api.copernica.com/v4/view/$id/profiles | Fetch all view profiles |
GET | api.copernica.com/v4/view/$id/rules | Fetch all view rules |
GET | api.copernica.com/v4/view/$id/rule/$id | Fetch a view rule |
POST | api.copernica.com/v4/view/$id/rules | Create a new view rule |
PUT | api.copernica.com/v4/view/$id/intentions | Update the view intentions |
POST | api.copernica.com/v4/view/$id/rebuild | Rebuild the view |
Miniview
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/collection/$id/miniviews | Create a new miniview |
GET | api.copernica.com/v4/miniview/$id | Fetch the miniview information |
PUT | api.copernica.com/v4/miniview/$id | Update the miniview information |
DELETE | api.copernica.com/v4/miniview/$id | Delete a miniview |
GET | api.copernica.com/v4/miniview/$id/subprofileids | Fetch all miniview subprofile IDs |
GET | api.copernica.com/v4/miniview/$id/subprofiles | Fetch all miniview subprofiles |
GET | api.copernica.com/v4/miniview/$id/views | Fetch all views for a miniview |
GET | api.copernica.com/v4/miniview/$id/minirules | Fetch all miniview minirules |
GET | api.copernica.com/v4/miniview/$id/minirule/$id | Fetch a miniview minirule |
POST | api.copernica.com/v4/miniview/$id/minirules | Create a new miniview minirule |
PUT | api.copernica.com/v4/miniview/$id/intentions | Update the miniview intentions |
POST | api.copernica.com/v4/miniview/$id/rebuild | Rebuild the miniview |
Rules & Minirules
Rules and minirules are made up of several conditions to create selections under a database or collection respectively. You can find API calls related to rules and their conditions in the table below.
Rules
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/view/$id/rules | Create a rule |
GET | api.copernica.com/v4/rule/$id | Fetch the rule information |
PUT | api.copernica.com/v4/rule/$id | Update the rule information |
DELETE | api.copernica.com/v4/rule/$id | Delete a rule |
POST | api.copernica.com/v4/rule/$id/conditions | Create a condition |
PUT | api.copernica.com/v4/condition/$type/$id | Update a condition |
DELETE | api.copernica.com/v4/condition/$type/$id | Delete a condition |
Minirules (for miniselections)
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/miniview/$id/minirules | Create a new minirule |
GET | api.copernica.com/v4/minirule/$id | Fetch the minirule information |
PUT | api.copernica.com/v4/minirule/$id | Update the minirule information |
DELETE | api.copernica.com/v4/minirule/$id | Delete a minirule |
POST | api.copernica.com/v4/minirule/$id/conditions | Create a minirule condition |
PUT | api.copernica.com/v4/minicondition/$type/$id | Update a minirule condition |
DELETE | api.copernica.com/v4/minicondition/$type/$id | Delete a minirule condition |
Profiles & Subprofiles
Profiles and subprofiles can be used to represent entities in your database, like your customers or orders. The relevant API calls can be found below.
Profile
Subprofile
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/profile/$id/subprofiles | Create a new subprofile |
GET | api.copernica.com/v4/subprofile/$id | Fetch the subprofile information |
PUT | api.copernica.com/v4/subprofile/$id | Update the subprofile information |
DELETE | api.copernica.com/v4/subprofile/$id | Delete a subprofile |
GET | api.copernica.com/v4/subprofile/$id/fields | Fetch all subprofile fields |
PUT | api.copernica.com/v4/subprofile/$id/fields | Update the subprofile fields |
GET | api.copernica.com/v4/subprofile/$id/html/emailings | Fetch all HTML mailings for a subprofile |
GET | api.copernica.com/v4/subprofile/$id/draganddrop/emailings | Fetch all drag and drop mailings for a subprofile |
GET | api.copernica.com/v4/subprofile/$id/html/destinations | Fetch all HTML destinations for a subprofile |
GET | api.copernica.com/v4/subprofile/$id/draganddrop/destination | Fetch all Marketing Suite destinations for a subprofile |
POST | api.copernica.com/v4/subprofile/$id/datarequest | Create a request for all data stored for a subprofile |
PUT | api.copernica.com/v4/subprofile/$id/unsubscribe | Execute unsubscribe behavior of a subprofile |
GET | api.copernica.com/v4/subprofile/$id/html/document/$id | Fetch the personalized HTML document for a subprofile |
HTML Mailings
The table below contains all API calls related to HTML documents, templates and mailings.
Mailings
Documents & Templates
Destinations
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/html/destination/$id | Fetch an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/body | Fetch the message body sent to the destination |
GET | api.copernica.com/v4/html/destinations/$id/fields | Fetch an emailing destination including profile fields |
GET | api.copernica.com/v4/html/destination/$id/statistics | Fetch the statistics for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/abuses | Fetch the abuses for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/clicks | Fetch the clicks for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/deliveries | Fetch the deliveries for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/errors | Fetch the errors for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/impressions | Fetch the impressions for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/unsubscribes | Fetch the unsubscribes for an emailing destination |
GET | api.copernica.com/v4/html/destination/$id/content | Fetch the received content for an emailing destination |
GET | api.copernica.com/v4/profile/$id/html/destinations | Fetch the HTML destinations for a profile |
GET | api.copernica.com/v4/subprofile/$id/html/destinations | Fetch the HTML destinations for a subprofile |
Statistics
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/html/abuses | Fetch all abuses for HTML mailings |
GET | api.copernica.com/v4/html/clicks | Fetch all clicks for HTML mailings |
GET | api.copernica.com/v4/html/deliveries | Fetch all deliveries for HTML mailings |
GET | api.copernica.com/v4/html/errors | Fetch all errors for HTML mailings |
GET | api.copernica.com/v4/html/impressions | Fetch all impressions for HTML mailings |
GET | api.copernica.com/v4/html/unsubscribes | Fetch all unsubscribes for HTML mailings |
Drag and drop Mailings
The table below contains all API calls related to Marketing Suite templates and emailings.
Mailings
Templates
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/draganddrop/templates | Fetch all templates |
GET | api.copernica.com/v4/draganddrop/template/$id | Fetch a template |
DELETE | api.copernica.com/v4/draganddrop/template/$id | Delete a template |
GET | api.copernica.com/v4/draganddrop/template/$id/statistics | Fetch the statistics for a template |
POST | api.copernica.com/v4/draganddrop/template/$id/translations | Create new language for a template |
GET | api.copernica.com/v4/draganddrop/template/$id/translations | Fetch all language from a template |
PUT | api.copernica.com/v4/draganddrop/template/$id/translations | Modify languages from a template |
GET | api.copernica.com/v4/draganddrop/directories | Fetch information of all template directory |
GET | api.copernica.com/v4/draganddrop/directory/$id | Fetch information of the template directory |
Messages & Destinations
Copernica uses the terms messages and destinations interchangeably in the Marketing Suite. Both refer to a specific message sent to a specific profile or subprofile. Please keep in mind that you can substitute 'message' by 'destination' or vice versa in all of the articles below, including the code examples.
Statistics
SMS mailings
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/smsmailing/$id | Fetch information for a SMS mailing |
Coupons
Type | Address | Omschrijving |
---|---|---|
GET | https://api.copernica.com/v4/couponcampaigns | Fetch all coupon campaigns |
POST | https://api.copernica.com/v4/couponcampaigns | Create a coupon campaign |
PUT | https://api.copernica.com/v4/couponcampaign/$id | Update coupon campaign information |
GET | https://api.copernica.com/v4/couponcampaign/$id | Fetch coupon campaign information |
PUT | https://api.copernica.com/v4/couponcampaign/$id/coupons | Create or update one or multiple coupons inside a campaign |
GET | https://api.copernica.com/v4/couponcampaign/$id/coupons | Fetch one or multiple coupons inside a campaign |
Media libraries
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/medialibrary/$id/files | Upload a file/image in a media library |
Datarequests
The result of data requests is stored for a while after completion. With the following methods you can retrieve the status and data of previously completed calls.
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v4/profile/$id/datarequest | Create a request for all data stored for a profile |
POST | api.copernica.com/v4/subprofile/$id/datarequest | Create a request for all data stored for a subprofile |
GET | api.copernica.com/v4/datarequest/$id/data | Fetch the data of a previous data request |
GET | api.copernica.com/v4/datarequest/$id/status | Fetch the status of a previous data request |
Logfiles
Copernica keeps extensive logfiles about everything that happens to your emails after sending. You can find all calls related to logfiles in the table below.
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/logfiles | Fetch logfile dates |
GET | api.copernica.com/v4/logfiles | Fetch logfile names |
GET | api.copernica.com/v4/logfile/$filename/csv | Fetch logfiles in CSV format |
GET | api.copernica.com/v4/logfile/$filename/json | Fetch logfiles in JSON format |
GET | api.copernica.com/v4/logfile/$filename/xml | Fetch logfiles in XML format |
Webhooks
Webhooks are processes that notify their user of events that happen in real time through HTTP POST. You can find all calls related to webhooks in the table below.
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/webhook/$id | Fetch a webhook |
POST | api.copernica.com/v4/webhooks | Create a webhook |
PUT | api.copernica.com/v4/webhook/$id | Update a webhook |
DELETE | api.copernica.com/v4/webhook/$id | Remove a webhook |
Sender domains
Within our software you can configure from which domain or subdomain do you to send your emails. If you want the 'FROM' address of your emails to be info@example.com, you need to provide 'example.com' as your sender domain.
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v4/senderdomain/$id | Fetch a senderdomain |
POST | api.copernica.com/v4/senderdomains | Create a senderdomain |
PUT | api.copernica.com/v4/senderdomain/$id | Update a senderdomain |
DELETE | api.copernica.com/v4/senderdomain/$id | Remove a senderdomain |