REST API v2
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 2 of the REST API. This article explains the new version (and how to switch) in full detail. Not ready to switch? You can find the documentation for version 1 here.
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
- Publisher Mailings
- Marketing Suite Mailings
- Datarequests
- Logfiles
Account
In the table below you can find a call to retrieve account information.
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v2/identity | Fetch the account information |
GET | api.copernica.com/v2/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
Views & Miniviews
Views are selection 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/v2/database/$id/views | Create a view |
POST | api.copernica.com/v2/view/$id/copy | Copy a view |
GET | api.copernica.com/v2/view/$id | Fetch the view information |
PUT | api.copernica.com/v2/view/$id | Update the view information |
DELETE | api.copernica.com/v2/view/$id | Delete a view |
GET | api.copernica.com/v2/view/$id/views | Fetch all nested views |
POST | api.copernica.com/v2/view/$id/views | Create a nested view |
GET | api.copernica.com/v2/view/$id/profileids | Fetch all view profile IDs |
GET | api.copernica.com/v2/view/$id/profiles | Fetch all view profiles |
GET | api.copernica.com/v2/view/$id/rules | Fetch all view rules |
GET | api.copernica.com/v2/view/$id/rule/$id | Fetch a view rule |
POST | api.copernica.com/v2/view/$id/rules | Create a new view rule |
PUT | api.copernica.com/v2/view/$id/intentions | Update the view intentions |
PUT | api.copernica.com/v2/view/$id/rebuild | Rebuild the view |
Miniview
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v2/collection/$id/miniviews | Create a new miniview |
GET | api.copernica.com/v2/miniview/$id | Fetch the miniview information |
PUT | api.copernica.com/v2/miniview/$id | Update the miniview information |
DELETE | api.copernica.com/v2/miniview/$id | Delete a miniview |
GET | api.copernica.com/v2/miniview/$id/subprofileids | Fetch all miniview subprofile IDs |
GET | api.copernica.com/v2/miniview/$id/subprofiles | Fetch all miniview subprofiles |
GET | api.copernica.com/v2/miniview/$id/views | Fetch all views for a miniview |
GET | api.copernica.com/v2/miniview/$id/minirules | Fetch all miniview minirules |
GET | api.copernica.com/v2/miniview/$id/minirule/$id | Fetch a miniview minirule |
POST | api.copernica.com/v2/miniview/$id/minirules | Create a new miniview minirule |
PUT | api.copernica.com/v2/miniview/$id/intentions | Update the miniview intentions |
PUT | api.copernica.com/v2/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/v2/view/$id/rules | Create a rule |
GET | api.copernica.com/v2/rule/$id | Fetch the rule information |
PUT | api.copernica.com/v2/rule/$id | Update the rule information |
DELETE | api.copernica.com/v2/rule/$id | Delete a rule |
POST | api.copernica.com/v2/rule/$id/conditions | Create a condition |
PUT | api.copernica.com/v2/condition/$type/$id | Update a condition |
DELETE | api.copernica.com/v2/condition/$type/$id | Delete a condition |
Minirules (for miniselections)
Type | Address | Description |
---|---|---|
POST | api.copernica.com/v2/miniview/$id/minirules | Create a new minirule |
GET | api.copernica.com/v2/minirule/$id | Fetch the minirule information |
PUT | api.copernica.com/v2/minirule/$id | Update the minirule information |
DELETE | api.copernica.com/v2/minirule/$id | Delete a minirule |
POST | api.copernica.com/v2/minirule/$id/conditions | Create a minirule condition |
DELETE | api.copernica.com/v2/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/v2/profile/$id/subprofiles | Create a new subprofile |
GET | api.copernica.com/v2/subprofile/$id | Fetch the subprofile information |
PUT | api.copernica.com/v2/subprofile/$id | Update the subprofile information |
DELETE | api.copernica.com/v2/subprofile/$id | Delete a subprofile |
GET | api.copernica.com/v2/subprofile/$id/fields | Fetch all subprofile fields |
PUT | api.copernica.com/v2/subprofile/$id/fields | Update the subprofile fields |
GET | api.copernica.com/v2/subprofile/$id/publisher/emailings | Fetch all Publisher mailings for a subprofile |
GET | api.copernica.com/v2/subprofile/$id/ms/emailings | Fetch all Marketing Suite mailings for a subprofile |
GET | api.copernica.com/v2/subprofile/$id/publisher/destinations | Fetch all Publisher destinations for a subprofile |
GET | api.copernica.com/v2/subprofile/$id/ms/destination | Fetch all Marketing Suite destinations for a subprofile |
POST | api.copernica.com/v2/subprofile/$id/datarequest | Create a request for all data stored for a subprofile |
PUT | api.copernica.com/v2/subprofile/$id/unsubscribe | Execute unsubscribe behavior of a subprofile |
Publisher Mailings
The table below contains all API calls related to Publisher documents, templates and mailings.
Mailings
Documents & Templates
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v2/publisher/documents | Fetch all documents |
GET | api.copernica.com/v2/publisher/document/$id | Fetch the document information |
DELETE | api.copernica.com/v2/publisher/document/$id | Delete a document |
GET | api.copernica.com/v2/publisher/document/$id/emailings | Fetch all emailings for a document |
GET | api.copernica.com/v2/publisher/document/$id/statistics | Fetch the statistics for a document |
GET | api.copernica.com/v2/publisher/templates | Fetch all templates |
GET | api.copernica.com/v2/publisher/template/$id | Fetch the template information |
DELETE | api.copernica.com/v2/publisher/template/$id | Delete a template |
GET | api.copernica.com/v2/publisher/template/$id/emailings | Fetch all emailings for a template |
GET | api.copernica.com/v2/publisher/template/$id/documents | Fetch all documents for a template |
Destinations
Statistics
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v2/publisher/abuses | Fetch all abuses for Publisher |
GET | api.copernica.com/v2/publisher/clicks | Fetch all clicks for Publisher |
GET | api.copernica.com/v2/publisher/deliveries | Fetch all deliveries for Publisher |
GET | api.copernica.com/v2/publisher/errors | Fetch all errors for Publisher |
GET | api.copernica.com/v2/publisher/impressions | Fetch all impressions for Publisher |
GET | api.copernica.com/v2/publisher/unsubscribes | Fetch all unsubscribes for Publisher |
Marketing Suite Mailings
The table below contains all API calls related to Marketing Suite templates and emailings.
Mailings
Templates
Type | Address | Description |
---|---|---|
GET | api.copernica.com/v2/ms/templates | Fetch all templates |
GET | api.copernica.com/v2/ms/template/$id | Fetch a template |
DELETE | api.copernica.com/v2/ms/template/$id | Delete a template |
GET | api.copernica.com/v2/ms/template/$id/statistics | Fetch the statistics for a template |
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
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/v2/email/$email/datarequest | Create a request for all data stored for an emailaddress |
POST | api.copernica.com/v2/profile/$id/datarequest | Create a request for all data stored for a profile |
POST | api.copernica.com/v2/subprofile/$id/datarequest | Create a request for all data stored for a subprofile |
GET | api.copernica.com/v2/datarequest/$id/data | Fetch the data of a previous data request |
GET | api.copernica.com/v2/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/v2/logfiles | Fetch logfile dates |
GET | api.copernica.com/v2/logfiles | Fetch logfile names |
GET | api.copernica.com/v2/logfile/$filename/csv | Fetch logfiles in CSV format |
GET | api.copernica.com/v2/logfile/$filename/json | Fetch logfiles in JSON format |
GET | api.copernica.com/v2/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/v2/webhook/$id | Fetch a webhook |
POST | api.copernica.com/v2/webhooks | Create a webhook |
PUT | api.copernica.com/v2/webhook/$id | Update a webhook |
DELETE | api.copernica.com/v2/webhook/$id | Remove a webhook |