# OnePageCRM

> Add and update contacts, deals and next actions in OnePageCRM, and log notes, calls and meetings.

App · 26 actions. Web page: https://docs.lodol.com/docs/integrations/onepagecrm

## Actions

### Add tag to contact

Put a tag on a contact, matching an existing tag whatever its case.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact. Use an ID from List contacts or an earlier step.
- Tag (`tag_name`, text, required): The tag to add.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Change contact status

Set a contact's status.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact. Use an ID from List contacts or an earlier step.
- Status (`status_id`, text, required): The status to set.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "contact": {
        "address_list": [
          {
            "address": "Unit 5, Business Innovation Centre",
            "city": "Upper Newcastle",
            "country_code": "IE",
            "state": "Galway",
            "type": "work",
            "zip_code": "H91 Y0T0"
          }
        ],
        "background": "Met at the annual Eco Conference.",
        "company_id": "5aba31ea9007ba0f570c92d5",
        "company_name": "Morgan's Forensic Lab",
        "created_at": "2018-05-16T11:52:09Z",
        "emails": [
          {
            "type": "work",
            "value": "joe.bloggs@example.com"
          }
        ],
        "first_name": "Joe",
        "id": "5aba31ea9007ba0f570c92d4",
        "job_title": "Engineer",
        "last_name": "Bloggs",
        "lead_source": "Email or Web",
        "lead_source_id": "email_web",
        "modified_at": "2018-05-16T11:52:09Z",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pending_deal": true,
        "phones": [
          {
            "type": "work",
            "value": "(912) 644-1770"
          }
        ],
        "starred": true,
        "status": "Prospect",
        "status_id": "5e31e030849d781e837b6ba1",
        "tags": [
          "VIP"
        ],
        "title": "Mr",
        "total_pendings": 999.99,
        "urls": [
          {
            "type": "linkedin",
            "value": "https://www.linkedin.com/in/joe-bloggs"
          }
        ]
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Complete action

Mark an action as done.

**Inputs**

- Action ID (`action_id`, text, required): The action, from List actions or an earlier step.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "action": {
        "assignee_id": "5aba31e99007ba0f570c12f7",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "created_at": "2018-05-16T11:52:09Z",
        "date": "2018-05-16",
        "done": false,
        "done_at": "2018-05-16",
        "exact_time": 1526472000,
        "id": "5aeac8789007ba56ffca92b9",
        "modified_at": "2018-05-16T12:52:09Z",
        "status": "date",
        "text": "Email Jane introducing our organisation"
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Create action

Add a next action for a contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact the action is for.
- Action (`text`, text, required): What to do, up to 140 characters.
- When (`status`, text): When it is due. OnePageCRM uses On a date if left empty. One of: `asap` (As soon as possible), `date` (On a date), `date_time` (At a time), `waiting` (Waiting for), `queued`.
- Due date (`date`, date): The day it is due, for On a date or At a time.
- Due time (`exact_time`, date and time): The moment it is due, for At a time.
- Assigned to (`assignee_id`, text): The user to assign it to. Leave empty for yourself.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "action": {
        "assignee_id": "5aba31e99007ba0f570c12f7",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "created_at": "2018-05-16T11:52:09Z",
        "date": "2018-05-16",
        "done": false,
        "done_at": "2018-05-16",
        "exact_time": 1526472000,
        "id": "5aeac8789007ba56ffca92b9",
        "modified_at": "2018-05-16T12:52:09Z",
        "status": "date",
        "text": "Email Jane introducing our organisation"
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Create contact

Add a contact to OnePageCRM.

**Inputs**

- First name (`first_name`, text): Their first name.
- Last name (`last_name`, text): Their last name. Give a last name or a company name.
- Company (`company_name`, text): Their company's name. OnePageCRM links an existing company with that name or makes one.
- Job title (`job_title`, text): Their job title.
- Title (`title`, text): Their title. One of: `Mr`, `Mrs`, `Ms`.
- Emails (`emails`, list): Their email addresses. This replaces any they already have.
- Phones (`phones`, list): Their phone numbers. This replaces any they already have.
- Addresses (`address_list`, list): Their addresses. This replaces any they already have.
- Status (`status_id`, text): Their status. OnePageCRM uses Lead if left empty.
- Tags (`tags`, list): Tags to put on them. This replaces any they already have.
- Lead source ID (`lead_source_id`, text): The ID of their lead source, such as advertisement.
- Background (`background`, text): Background notes about them.
- Owner (`owner_id`, text): The user who owns them. Leave empty for yourself.
- Starred (`starred`, true/false): Turn on to star them.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "contact": {
        "address_list": [
          {
            "address": "Unit 5, Business Innovation Centre",
            "city": "Upper Newcastle",
            "country_code": "IE",
            "state": "Galway",
            "type": "work",
            "zip_code": "H91 Y0T0"
          }
        ],
        "background": "Met at the annual Eco Conference.",
        "company_id": "5aba31ea9007ba0f570c92d5",
        "company_name": "Morgan's Forensic Lab",
        "created_at": "2018-05-16T11:52:09Z",
        "emails": [
          {
            "type": "work",
            "value": "joe.bloggs@example.com"
          }
        ],
        "first_name": "Joe",
        "id": "5aba31ea9007ba0f570c92d4",
        "job_title": "Engineer",
        "last_name": "Bloggs",
        "lead_source": "Email or Web",
        "lead_source_id": "email_web",
        "modified_at": "2018-05-16T11:52:09Z",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pending_deal": true,
        "phones": [
          {
            "type": "work",
            "value": "(912) 644-1770"
          }
        ],
        "starred": true,
        "status": "Prospect",
        "status_id": "5e31e030849d781e837b6ba1",
        "tags": [
          "VIP"
        ],
        "title": "Mr",
        "total_pendings": 999.99,
        "urls": [
          {
            "type": "linkedin",
            "value": "https://www.linkedin.com/in/joe-bloggs"
          }
        ]
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Create deal

Add a deal for a contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact the deal is with.
- Name (`name`, text, required): The deal's name, up to 60 characters.
- Amount (`amount`, number): Its value, per month for a multi-month deal.
- Months (`months`, number): How many months it is paid for: 1 for a one-off deal. At least 1.
- Status (`status`, text): Whether it is pending, won or lost. One of: `pending`, `won`, `lost`.
- Stage (`stage`, number): How far a pending deal has got, as a pipeline stage number from 0 to 100. From 0 to 99.
- Pipeline (`pipeline_id`, text): The pipeline it is in.
- Expected close date (`expected_close_date`, date): When a pending deal should close.
- Close date (`close_date`, date): When a won or lost deal closed.
- Date (`date`, date): The deal's date. OnePageCRM uses today if left empty.
- Cost (`cost`, number): Its cost.
- Notes (`text`, text): Notes on the deal.
- Owner (`owner_id`, text): The user who owns it. Leave empty for yourself.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "deal": {
        "amount": 99.99,
        "author": "Jane D.",
        "close_date": "2018-04-15",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "contact_info": {
          "company": "Big Company Inc.",
          "contact_name": "Joe Bloggs"
        },
        "cost": 0.0,
        "created_at": "2018-03-15T16:10:45Z",
        "date": "2018-04-15",
        "expected_close_date": "2018-04-15",
        "id": "5aaa9b059007ba08c9ebaf58",
        "modified_at": "2018-03-15T16:10:45Z",
        "months": 1,
        "name": "Solar panels",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pipeline_id": "5c96306b849d78b896b6f8ca",
        "stage": 50,
        "status": "pending",
        "text": "Fingers crossed!",
        "total_amount": 99.99
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Create note

Log a note on a contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact the note is about.
- Note (`text`, text, required): The note. [b]bold[/b] and [i]italic[/i] work.
- Date (`date`, date): The note's date. OnePageCRM uses today if left empty.
- Deal ID (`linked_deal_id`, text): A deal to link the note to.
- Notify (`user_ids_to_notify`, list): Users to notify about the note.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "note": {
        "author": "Jane D.",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "created_at": "2018-05-16T11:52:09Z",
        "date": "2018-05-16",
        "id": "5afc1b69d556730b580596cb",
        "linked_deal_id": "5aaa9b059007ba08c9ebaf58",
        "modified_at": "2018-05-16T11:52:09Z",
        "text": "Met Jane at the ABC conference."
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Delete contact

Delete a contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact to delete.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Delete deal

Delete a deal.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal to delete.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Get company

Get one company.

**Inputs**

- Company (`company_id`, text, required): The company.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "company": {
        "address": {
          "address": "Unit 5, Business Innovation Centre",
          "city": "Upper Newcastle",
          "country_code": "IE",
          "state": "Galway",
          "zip_code": "H91 Y0T0"
        },
        "contacts_count": 3,
        "created_at": "2018-05-16T11:52:09Z",
        "description": "For all your security needs",
        "id": "5aba31e99007ba0f570c92ac",
        "modified_at": "2018-05-16T11:52:09Z",
        "name": "Crockett & Tubbs Security",
        "pending_deals_count": 1,
        "phone": "(912) 644-1771",
        "total_pending_amount": 99.99,
        "total_won_amount": 999.99,
        "url": "https://example.com",
        "won_deals_count": 5
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Get contact

Get one contact, with their next action.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact. Use an ID from List contacts or an earlier step.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "contact": {
        "address_list": [
          {
            "address": "Unit 5, Business Innovation Centre",
            "city": "Upper Newcastle",
            "country_code": "IE",
            "state": "Galway",
            "type": "work",
            "zip_code": "H91 Y0T0"
          }
        ],
        "background": "Met at the annual Eco Conference.",
        "company_id": "5aba31ea9007ba0f570c92d5",
        "company_name": "Morgan's Forensic Lab",
        "created_at": "2018-05-16T11:52:09Z",
        "emails": [
          {
            "type": "work",
            "value": "joe.bloggs@example.com"
          }
        ],
        "first_name": "Joe",
        "id": "5aba31ea9007ba0f570c92d4",
        "job_title": "Engineer",
        "last_name": "Bloggs",
        "lead_source": "Email or Web",
        "lead_source_id": "email_web",
        "modified_at": "2018-05-16T11:52:09Z",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pending_deal": true,
        "phones": [
          {
            "type": "work",
            "value": "(912) 644-1770"
          }
        ],
        "starred": true,
        "status": "Prospect",
        "status_id": "5e31e030849d781e837b6ba1",
        "tags": [
          "VIP"
        ],
        "title": "Mr",
        "total_pendings": 999.99,
        "urls": [
          {
            "type": "linkedin",
            "value": "https://www.linkedin.com/in/joe-bloggs"
          }
        ]
      },
      "next_action": {
        "assignee_id": "5aba31e99007ba0f570c12f7",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "created_at": "2018-05-16T11:52:09Z",
        "date": "2018-05-16",
        "done": false,
        "done_at": "2018-05-16",
        "exact_time": 1526472000,
        "id": "5aeac8789007ba56ffca92b9",
        "modified_at": "2018-05-16T12:52:09Z",
        "status": "date",
        "text": "Email Jane introducing our organisation"
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Get deal

Get one deal.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal, from List deals or an earlier step.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "deal": {
        "amount": 99.99,
        "author": "Jane D.",
        "close_date": "2018-04-15",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "contact_info": {
          "company": "Big Company Inc.",
          "contact_name": "Joe Bloggs"
        },
        "cost": 0.0,
        "created_at": "2018-03-15T16:10:45Z",
        "date": "2018-04-15",
        "expected_close_date": "2018-04-15",
        "id": "5aaa9b059007ba08c9ebaf58",
        "modified_at": "2018-03-15T16:10:45Z",
        "months": 1,
        "name": "Solar panels",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pipeline_id": "5c96306b849d78b896b6f8ca",
        "stage": 50,
        "status": "pending",
        "text": "Fingers crossed!",
        "total_amount": 99.99
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List actions

List next actions in Action Stream order: ASAP first, then by due date.

**Inputs**

- Contact ID (`contact_id`, text): Only actions for this contact.
- Company (`company_id`, text): Only records for contacts at this company.
- Assigned to (`assignee_id`, text): Only actions assigned to this user.
- When (`status`, text): Only actions of this kind. One of: `asap` (As soon as possible), `date` (On a date), `date_time` (At a time), `waiting` (Waiting for), `queued`, `queued_with_date` (Queued with a date), `done`.
- Only done (`done`, true/false): Turn on for completed actions only.
- Changed since (`modified_since`, date): Only records changed on or after this day.
- Date to filter on (`date_filter`, text): Which date From and To apply to. Use From and To or Changed since, not both. One of: `created_at` (Date added), `modified_at` (Date changed), `date` (Due date).
- From (`since`, date): Only records whose chosen date is on or after this day.
- To (`until`, date): Only records whose chosen date is on or before this day.
- Sort by (`sort_by`, text): What to sort by. One of: `created_at` (Date added), `modified_at` (Date changed).
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "actions": [
        {
          "action": {
            "assignee_id": "5aba31e99007ba0f570c12f7",
            "contact_id": "5aba31ea9007ba0f570c92d4",
            "created_at": "2018-05-16T11:52:09Z",
            "date": "2018-05-16",
            "done": false,
            "done_at": "2018-05-16",
            "exact_time": 1526472000,
            "id": "5aeac8789007ba56ffca92b9",
            "modified_at": "2018-05-16T12:52:09Z",
            "status": "date",
            "text": "Email Jane introducing our organisation"
          }
        }
      ],
      "max_page": 1,
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List calls

List phone calls logged with contacts.

**Inputs**

- Contact ID (`contact_id`, text): Only calls with this contact.
- Company (`company_id`, text): Only records for contacts at this company.
- Changed since (`modified_since`, date): Only records changed on or after this day.
- Date to filter on (`date_filter`, text): Which date From and To apply to. Use From and To or Changed since, not both. One of: `created_at` (Date added), `modified_at` (Date changed), `call_time` (Call time).
- From (`since`, date): Only records whose chosen date is on or after this day.
- To (`until`, date): Only records whose chosen date is on or before this day.
- Sort by (`sort_by`, text): What to sort by. One of: `created_at` (Date added), `modified_at` (Date changed).
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "calls": [
        {
          "call": {
            "author": "Jane D.",
            "call_result": "interested",
            "call_time_int": 1525273653,
            "contact_id": "5aba31ea9007ba0f570c92d4",
            "created_at": "2018-05-16T11:52:09Z",
            "id": "5afc1b69d556730b580596cb",
            "modified_at": "2018-05-16T11:52:09Z",
            "phone_number": "(912) 644-1770 (mobile)",
            "recording_link": "https://example.com/recording.mp3",
            "text": "Mary is interested in coming in.",
            "via": "phone"
          }
        }
      ],
      "max_page": 1,
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List companies

List companies, filtered and sorted as you choose.

**Inputs**

- Name (`name`, text): Only companies whose name matches this.
- Contact search (`search`, text): Only companies with a contact whose name, company or phone number matches this.
- Phone (`phone`, text): Only companies with this phone number.
- Tag (`tag`, text): Only companies with a contact who has this tag.
- Status (`status_id`, text): Only companies with a contact who has this status.
- Owner (`owner_id`, text): Only companies with a contact owned by this user.
- Include team's contacts (`team`, true/false): Turn on so the contact filters include contacts owned by other users.
- Sort by (`sort_by`, text): What to sort by. One of: `name`, `created_at` (Date added), `modified_at` (Date changed).
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "companies": [
        {
          "company": {
            "address": {
              "address": "Unit 5, Business Innovation Centre",
              "city": "Upper Newcastle",
              "country_code": "IE",
              "state": "Galway",
              "zip_code": "H91 Y0T0"
            },
            "contacts_count": 3,
            "created_at": "2018-05-16T11:52:09Z",
            "description": "For all your security needs",
            "id": "5aba31e99007ba0f570c92ac",
            "modified_at": "2018-05-16T11:52:09Z",
            "name": "Crockett & Tubbs Security",
            "pending_deals_count": 1,
            "phone": "(912) 644-1771",
            "total_pending_amount": 99.99,
            "total_won_amount": 999.99,
            "url": "https://example.com",
            "won_deals_count": 5
          }
        }
      ],
      "max_page": 1,
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List contacts

List contacts, filtered and sorted as you choose.

**Inputs**

- Search (`search`, text): Only contacts whose name, company or phone number matches this.
- Email (`email`, text): Only contacts with this email address.
- Phone (`phone`, text): Only contacts with this phone number.
- Tag (`tag`, text): Only contacts with this tag.
- Status (`status_id`, text): Only contacts with this status.
- Company (`company_id`, text): Only records for contacts at this company.
- Owner (`owner_id`, text): Only contacts owned by this user.
- Include team's contacts (`team`, true/false): Turn on to include contacts owned by other users.
- Starred (`starred`, true/false): Only starred contacts.
- Has pending deal (`pending_deal`, true/false): Only contacts with a pending deal.
- Lead source ID (`lead_source_id`, text): Only contacts with this lead source.
- Changed since (`modified_since`, date): Only records changed on or after this day.
- Date to filter on (`date_filter`, text): Which date From and To apply to. Use From and To or Changed since, not both. One of: `created_at` (Date added), `modified_at` (Date changed).
- From (`since`, date): Only records whose chosen date is on or after this day.
- To (`until`, date): Only records whose chosen date is on or before this day.
- Sort by (`sort_by`, text): What to sort by. One of: `created_at` (Date added), `modified_at` (Date changed), `first_name` (First name), `last_name` (Last name), `company_name` (Company), `name`.
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "contacts": [
        {
          "contact": {
            "address_list": [
              {
                "address": "Unit 5, Business Innovation Centre",
                "city": "Upper Newcastle",
                "country_code": "IE",
                "state": "Galway",
                "type": "work",
                "zip_code": "H91 Y0T0"
              }
            ],
            "background": "Met at the annual Eco Conference.",
            "company_id": "5aba31ea9007ba0f570c92d5",
            "company_name": "Morgan's Forensic Lab",
            "created_at": "2018-05-16T11:52:09Z",
            "emails": [
              {
                "type": "work",
                "value": "joe.bloggs@example.com"
              }
            ],
            "first_name": "Joe",
            "id": "5aba31ea9007ba0f570c92d4",
            "job_title": "Engineer",
            "last_name": "Bloggs",
            "lead_source": "Email or Web",
            "lead_source_id": "email_web",
            "modified_at": "2018-05-16T11:52:09Z",
            "owner_id": "5aba31e99007ba0f570c12f7",
            "pending_deal": true,
            "phones": [
              {
                "type": "work",
                "value": "(912) 644-1770"
              }
            ],
            "starred": true,
            "status": "Prospect",
            "status_id": "5e31e030849d781e837b6ba1",
            "tags": [
              "VIP"
            ],
            "title": "Mr",
            "total_pendings": 999.99,
            "urls": [
              {
                "type": "linkedin",
                "value": "https://www.linkedin.com/in/joe-bloggs"
              }
            ]
          },
          "next_action": {
            "assignee_id": "5aba31e99007ba0f570c12f7",
            "contact_id": "5aba31ea9007ba0f570c92d4",
            "created_at": "2018-05-16T11:52:09Z",
            "date": "2018-05-16",
            "done": false,
            "done_at": "2018-05-16",
            "exact_time": 1526472000,
            "id": "5aeac8789007ba56ffca92b9",
            "modified_at": "2018-05-16T12:52:09Z",
            "status": "date",
            "text": "Email Jane introducing our organisation"
          }
        }
      ],
      "max_page": 1,
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List deals

List deals, filtered and sorted as you choose.

**Inputs**

- Search (`search`, text): Only deals whose name, contact or company matches this.
- Status (`status`, text): Only deals with this status. One of: `pending`, `won`, `lost`, `closed` (Won or lost).
- Pipeline (`pipeline_id`, text): Only deals in this pipeline.
- Stage (`stage`, number): Only pending deals at this stage number.
- Owner (`owner_id`, text): Only deals owned by this user.
- Contact ID (`contact_id`, text): Only deals for this contact.
- Company (`company_id`, text): Only records for contacts at this company.
- Tag (`tag`, text): Only deals for contacts with this tag.
- Changed since (`modified_since`, date): Only records changed on or after this day.
- Date to filter on (`date_filter`, text): Which date From and To apply to. Use From and To or Changed since, not both. One of: `created_at` (Date added), `modified_at` (Date changed), `date` (Deal date), `close_date` (Close date), `expected_close_date` (Expected close date).
- From (`since`, date): Only records whose chosen date is on or after this day.
- To (`until`, date): Only records whose chosen date is on or before this day.
- Sort by (`sort_by`, text): What to sort by. One of: `created_at` (Date added), `modified_at` (Date changed), `date` (Deal date), `close_date` (Close date), `expected_close_date` (Expected close date).
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "deals": [
        {
          "deal": {
            "amount": 99.99,
            "author": "Jane D.",
            "close_date": "2018-04-15",
            "contact_id": "5aba31ea9007ba0f570c92d4",
            "contact_info": {
              "company": "Big Company Inc.",
              "contact_name": "Joe Bloggs"
            },
            "cost": 0.0,
            "created_at": "2018-03-15T16:10:45Z",
            "date": "2018-04-15",
            "expected_close_date": "2018-04-15",
            "id": "5aaa9b059007ba08c9ebaf58",
            "modified_at": "2018-03-15T16:10:45Z",
            "months": 1,
            "name": "Solar panels",
            "owner_id": "5aba31e99007ba0f570c12f7",
            "pipeline_id": "5c96306b849d78b896b6f8ca",
            "stage": 50,
            "status": "pending",
            "text": "Fingers crossed!",
            "total_amount": 99.99
          }
        }
      ],
      "max_page": 1,
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List meetings

List meetings logged with contacts.

**Inputs**

- Contact ID (`contact_id`, text): Only meetings with this contact.
- Company (`company_id`, text): Only records for contacts at this company.
- Changed since (`modified_since`, date): Only records changed on or after this day.
- Date to filter on (`date_filter`, text): Which date From and To apply to. Use From and To or Changed since, not both. One of: `created_at` (Date added), `modified_at` (Date changed), `meeting_time` (Meeting time).
- From (`since`, date): Only records whose chosen date is on or after this day.
- To (`until`, date): Only records whose chosen date is on or before this day.
- Sort by (`sort_by`, text): What to sort by. One of: `created_at` (Date added), `modified_at` (Date changed).
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "max_page": 1,
      "meetings": [
        {
          "meeting": {
            "author": "Jane D.",
            "contact_id": "5aba31ea9007ba0f570c92d4",
            "created_at": "2018-05-16T11:52:09Z",
            "id": "5afc1b69d556730b580596cb",
            "meeting_time_int": 1525273653,
            "modified_at": "2018-05-16T11:52:09Z",
            "place": "Meeting room 1",
            "text": "Walked through the proposal."
          }
        }
      ],
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List notes

List notes logged on contacts.

**Inputs**

- Contact ID (`contact_id`, text): Only notes on this contact.
- Company (`company_id`, text): Only records for contacts at this company.
- Changed since (`modified_since`, date): Only records changed on or after this day.
- Date to filter on (`date_filter`, text): Which date From and To apply to. Use From and To or Changed since, not both. One of: `created_at` (Date added), `modified_at` (Date changed), `date` (Note date).
- From (`since`, date): Only records whose chosen date is on or after this day.
- To (`until`, date): Only records whose chosen date is on or before this day.
- Sort by (`sort_by`, text): What to sort by. One of: `created_at` (Date added), `modified_at` (Date changed), `date` (Note date).
- Order (`order`, text): Ascending or descending, when sorting. One of: `asc` (Ascending), `desc` (Descending).
- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "max_page": 1,
      "notes": [
        {
          "note": {
            "author": "Jane D.",
            "contact_id": "5aba31ea9007ba0f570c92d4",
            "created_at": "2018-05-16T11:52:09Z",
            "date": "2018-05-16",
            "id": "5afc1b69d556730b580596cb",
            "linked_deal_id": "5aaa9b059007ba08c9ebaf58",
            "modified_at": "2018-05-16T11:52:09Z",
            "text": "Met Jane at the ABC conference."
          }
        }
      ],
      "page": 1,
      "per_page": 10,
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List pipelines

List your deal pipelines and their stages.

**Inputs**

- Page (`page`, number): Which page to read, counting from 1. At least 1.
- Page size (`per_page`, number): How many a page holds, up to 100. OnePageCRM uses 10 if left empty. From 1 to 100.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "max_page": 1,
      "page": 1,
      "per_page": 10,
      "pipelines": [
        {
          "pipeline": {
            "default": true,
            "id": "5c96306b849d78b896b6f8ca",
            "name": "Default pipeline",
            "stages": [
              {
                "label": "Negotiation",
                "stage": 80
              }
            ],
            "type": "sales"
          }
        }
      ],
      "total_count": 1
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List statuses

List the contact statuses on your account, such as Lead or Customer.

**Inputs**: None.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "status": {
          "color": "f96600",
          "description": "Actively selling to these people",
          "id": "5aead4809007ba56ffca942e",
          "status": "prospect",
          "text": "Prospect"
        }
      }
    ],
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### List users

List the users on your OnePageCRM account.

**Inputs**: None.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "user": {
          "account_rights": [
            "admin"
          ],
          "company_name": "Big Company Inc.",
          "country_code": "IE",
          "email": "jane.doe@example.com",
          "first_name": "Jane",
          "id": "5aba31e99007ba0f570c12f7",
          "last_name": "Doe",
          "photo_url": "https://example.com/jane-doe.jpg"
        }
      }
    ],
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Log call

Log a phone call with a contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact the call was with.
- Result (`call_result`, text): The key of one of your account's call results, such as interested.
- Notes (`text`, text): Notes on the call.
- When (`call_time_int`, date and time): When the call happened. OnePageCRM uses now if left empty.
- Phone number (`phone_number`, text): The number called.
- Recording link (`recording_link`, text): A link to the call's recording.
- Notify (`user_ids_to_notify`, list): Users to notify about the call.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "call": {
        "author": "Jane D.",
        "call_result": "interested",
        "call_time_int": 1525273653,
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "created_at": "2018-05-16T11:52:09Z",
        "id": "5afc1b69d556730b580596cb",
        "modified_at": "2018-05-16T11:52:09Z",
        "phone_number": "(912) 644-1770 (mobile)",
        "recording_link": "https://example.com/recording.mp3",
        "text": "Mary is interested in coming in.",
        "via": "phone"
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Log meeting

Log a meeting with a contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact the meeting was with.
- Notes (`text`, text): Notes on the meeting.
- When (`meeting_time_int`, date and time): When the meeting happened. OnePageCRM uses now if left empty.
- Place (`place`, text): Where it was, up to 100 characters.
- Notify (`user_ids_to_notify`, list): Users to notify about the meeting.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "meeting": {
        "author": "Jane D.",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "created_at": "2018-05-16T11:52:09Z",
        "id": "5afc1b69d556730b580596cb",
        "meeting_time_int": 1525273653,
        "modified_at": "2018-05-16T11:52:09Z",
        "place": "Meeting room 1",
        "text": "Walked through the proposal."
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Update contact

Change a contact. Only the fields you fill in are changed; lists you fill in replace the old ones.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact. Use an ID from List contacts or an earlier step.
- First name (`first_name`, text): Their first name.
- Last name (`last_name`, text): Their last name.
- Company (`company_name`, text): Their company's name. OnePageCRM links an existing company with that name or makes one.
- Job title (`job_title`, text): Their job title.
- Title (`title`, text): Their title. One of: `Mr`, `Mrs`, `Ms`.
- Emails (`emails`, list): Their email addresses. This replaces any they already have.
- Phones (`phones`, list): Their phone numbers. This replaces any they already have.
- Addresses (`address_list`, list): Their addresses. This replaces any they already have.
- Status (`status_id`, text): Their status.
- Tags (`tags`, list): Tags to put on them. This replaces any they already have.
- Lead source ID (`lead_source_id`, text): The ID of their lead source, such as advertisement.
- Background (`background`, text): Background notes about them.
- Owner (`owner_id`, text): The user who owns them. Leave empty for yourself.
- Starred (`starred`, true/false): Turn on to star them.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "contact": {
        "address_list": [
          {
            "address": "Unit 5, Business Innovation Centre",
            "city": "Upper Newcastle",
            "country_code": "IE",
            "state": "Galway",
            "type": "work",
            "zip_code": "H91 Y0T0"
          }
        ],
        "background": "Met at the annual Eco Conference.",
        "company_id": "5aba31ea9007ba0f570c92d5",
        "company_name": "Morgan's Forensic Lab",
        "created_at": "2018-05-16T11:52:09Z",
        "emails": [
          {
            "type": "work",
            "value": "joe.bloggs@example.com"
          }
        ],
        "first_name": "Joe",
        "id": "5aba31ea9007ba0f570c92d4",
        "job_title": "Engineer",
        "last_name": "Bloggs",
        "lead_source": "Email or Web",
        "lead_source_id": "email_web",
        "modified_at": "2018-05-16T11:52:09Z",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pending_deal": true,
        "phones": [
          {
            "type": "work",
            "value": "(912) 644-1770"
          }
        ],
        "starred": true,
        "status": "Prospect",
        "status_id": "5e31e030849d781e837b6ba1",
        "tags": [
          "VIP"
        ],
        "title": "Mr",
        "total_pendings": 999.99,
        "urls": [
          {
            "type": "linkedin",
            "value": "https://www.linkedin.com/in/joe-bloggs"
          }
        ]
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```

### Update deal

Change a deal. Only the fields you fill in are changed.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal, from List deals or an earlier step.
- Name (`name`, text): The deal's name, up to 60 characters.
- Amount (`amount`, number): Its value, per month for a multi-month deal.
- Months (`months`, number): How many months it is paid for: 1 for a one-off deal. At least 1.
- Status (`status`, text): Whether it is pending, won or lost. One of: `pending`, `won`, `lost`.
- Stage (`stage`, number): How far a pending deal has got, as a pipeline stage number from 0 to 100. From 0 to 99.
- Pipeline (`pipeline_id`, text): The pipeline it is in.
- Expected close date (`expected_close_date`, date): When a pending deal should close.
- Close date (`close_date`, date): When a won or lost deal closed.
- Date (`date`, date): The deal's date. OnePageCRM uses today if left empty.
- Cost (`cost`, number): Its cost.
- Notes (`text`, text): Notes on the deal.
- Owner (`owner_id`, text): The user who owns it. Leave empty for yourself.

**Outputs**

- `data` (object): The response from OnePageCRM.

**Example output**

```json
{
  "data": {
    "data": {
      "deal": {
        "amount": 99.99,
        "author": "Jane D.",
        "close_date": "2018-04-15",
        "contact_id": "5aba31ea9007ba0f570c92d4",
        "contact_info": {
          "company": "Big Company Inc.",
          "contact_name": "Joe Bloggs"
        },
        "cost": 0.0,
        "created_at": "2018-03-15T16:10:45Z",
        "date": "2018-04-15",
        "expected_close_date": "2018-04-15",
        "id": "5aaa9b059007ba08c9ebaf58",
        "modified_at": "2018-03-15T16:10:45Z",
        "months": 1,
        "name": "Solar panels",
        "owner_id": "5aba31e99007ba0f570c12f7",
        "pipeline_id": "5c96306b849d78b896b6f8ca",
        "stage": 50,
        "status": "pending",
        "text": "Fingers crossed!",
        "total_amount": 99.99
      }
    },
    "message": "OK",
    "status": 0,
    "timestamp": 1528373119
  }
}
```
