API > Campaigns > Get All Campaigns

GET https://emailoctopus.com/api/1.2/campaigns

Get details of all campaigns.

Parameters
api_key (string) Your API key.
limit (integer) A limit on the number of lists to return, ranging from 1 to 100. Default is 100.
page (integer) A specific page to return records from. Defaults to 1.
200 (Success) Returns
data (array of structs)

Details of each campaign:

id (string) The identifier of the campaign.
status (string) The status of the campaign (DRAFT/SENDING/SENT/ERROR).
name (string) The name of the campaign.
subject (string) The subject of the campaign.
to (array) The ids of the lists the campaign was sent to.
from (struct)

The sender of the campaign:

name (string) The name the campaign was sent from.
email_address (string) The email address the campaign was sent from.
content (struct)

The content of the campaign:

html (string) The campaign's HTML content.
plain_text (string) The campaign's plain text content.
created_at (string) When the campaign was created, in ISO 8601 format.
sent_at (string) When the campaign was sent, in ISO 8601 format.
paging (array)

URLs to navigate the results:

previous (nullable string) A link for the immediate previous page of results.
next (nullable string) A link for the immediate next page of results.
Non-200 (Error) Returns

Details of the error:

code (string) The error code.
message (string) A description of the error.
Method-specific Error Codes
None.
API-wide Error Codes
INVALID_PARAMETERS Parameters are missing or invalid.
API_KEY_INVALID Your API key is invalid.
UNAUTHORISED You're not authorised to perform that action.
NOT_FOUND The requested endpoint does not exist.
UNKNOWN An unknown error has occurred.
Example Request
/api/1.2/campaigns?api_key=00000000-0000-0000-0000-000000000000
Example Response
                        
                            {
                                "data": [
                                    {
                                        "id": "00000000-0000-0000-0000-000000000000",
                                        "status": "SENT",
                                        "name": "Foo",
                                        "subject": "Bar",
                                        "to": [
                                            "00000000-0000-0000-0000-000000000001",
                                            "00000000-0000-0000-0000-000000000002"
                                        ],
                                        "from": {
                                            "name": "John Doe",
                                            
                                            "email_address": "john.doe@gmail.com"
                                            
                                        },
                                        "content": {
                                            "html": "<html>Foo Bar<html>",
                                            "plain_text": "Foo Bar"
                                        },
                                        "created_at": "2017-11-17T15:25:59+00:00",
                                        "sent_at": "2017-11-18T15:25:59+00:00"
                                    },
                                    {
                                        "id": "00000000-0000-0000-0000-000000000003",
                                        "status": "SENT",
                                        "name": "Bar",
                                        "subject": "Foo",
                                        "to": [
                                            "00000000-0000-0000-0000-000000000004",
                                            "00000000-0000-0000-0000-000000000005"
                                        ],
                                        "from": {
                                            "name": "Jane Doe",
                                            
                                            "email_address": "jane.doe@gmail.com"
                                            
                                        },
                                        "content": {
                                            "html": "<html>Bar Foo<html>",
                                            "plain_text": "Bar Foo"
                                        },
                                        "created_at": "2017-11-19T15:25:59+00:00",
                                        "sent_at": "2017-11-20T15:25:59+00:00"
                                    }
                                ],
                                "paging": {
                                    "next": null,
                                    "previous": null
                                }
                            }