Productive V2 API

API Endpoint

This api is implemented according to JSON API spec.


API Endpoint

The latest API endpoint is https://api.productive.io/api/v2


Authorization

Most resources have authorization on them. If successfully authorized, you will get a response containing the resource; however, if you aren’t authorized then you will be given HTTP status of 401, and an error message.


Authentication

To authenticate yourself, add your API token to the X-Auth-Token header for every request.

To access your organization data, add your organzation ID to the X-Organization-Id header for every request.


Pagination

Pagination has to be set in the following style:

?page[number]=2&page[size]=20

Where page[number]= is the page you want to view, and page[size]= is the number of resources you want to return.


Filter

If you would like to add filtration to your query, you can do that by setting the supported filter parameters in the following way:

  • ?filter[person_id]=24


Activities

Activities

Supported filter params

  • task_id

  • project_id

  • deal_id

  • company_id

  • person_id

  • creator_id

  • pinned

  • root_type

  • after

  • before

GET /api/v2/activities
Requestsreturns activities

GET  /api/v2/activities?filter[task_id]=82

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "7",
      "type": "activities",
      "attributes": {
        "event": "create",
        "changes": "",
        "item_id": 82,
        "item_type": "task",
        "item_name": "#1: Ticket title",
        "item_deleted_at": null,
        "parent_id": 279,
        "parent_type": "project",
        "parent_name": "test project",
        "parent_deleted_at": null,
        "root_id": 279,
        "root_type": "project",
        "root_name": "test project",
        "root_deleted_at": null,
        "deal_is_budget": false,
        "created_at": "2018-02-15T22:33:50.000+01:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1238"
          }
        },
        "comment": {
          "data": null
        },
        "email": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1238",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user92@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:33:50.000+01:00",
        "last_seen_at": "2018-02-15T22:33:50.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1704"
          }
        }
      }
    },
    {
      "id": "1704",
      "type": "companies",
      "attributes": {
        "name": "Organization64",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:33:49.641+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/activities?filter%5Btask_id%5D=82&page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get activities
GET/api/v2/activities


GET /api/v2/activities/1
Requestsreturns activity

GET  /api/v2/activities/12

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "activities",
    "attributes": {
      "event": "create",
      "changes": "",
      "item_id": 87,
      "item_type": "task",
      "item_name": "#1: Ticket title",
      "item_deleted_at": null,
      "parent_id": 294,
      "parent_type": "project",
      "parent_name": "test project",
      "parent_deleted_at": null,
      "root_id": 294,
      "root_type": "project",
      "root_name": "test project",
      "root_deleted_at": null,
      "deal_is_budget": false,
      "created_at": "2018-02-15T22:33:55.000+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1268"
        }
      },
      "comment": {
        "data": null
      },
      "email": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1268",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user122@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:33:55.000+01:00",
        "last_seen_at": "2018-02-15T22:33:55.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1749"
          }
        }
      }
    },
    {
      "id": "1749",
      "type": "companies",
      "attributes": {
        "name": "Organization67",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:33:54.901+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a activity
GET/api/v2/activities/{id}

URI Parameters
HideShow
id
number (required) Example: 1

activity id


Attachments

Attachments

GET /api/v2/attachments/1
Requestsreturns attachment

GET  /api/v2/attachments/9

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "9",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/009/original/img.png?1518730435",
      "thumb": "/system/attachments/files/000/000/009/thumb/img.png?1518730435",
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/9eac0dc0de01dbd010e74c05757ebe2c/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wMi0xNlQwNzozMzo1NloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "bm/2gRY/6Zr1OTMyApAeNhUF+aA=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1274"
        }
      }
    }
  },
  "included": [
    {
      "id": "1274",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user128@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:33:56.000+01:00",
        "last_seen_at": "2018-02-15T22:33:56.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1758"
          }
        }
      }
    },
    {
      "id": "1758",
      "type": "companies",
      "attributes": {
        "name": "Organization68",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:33:55.789+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a attachment
GET/api/v2/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id


POST /api/v2/attachments
Requestscreates attachmentreturns error

POST  /api/v2/attachments

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "attachable_id": "23",
      "attachable_type": "comment"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": null,
      "size": null,
      "url": "/system/attachments/files/000/000/011/original/img.png",
      "thumb": null,
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/786b010686bbf04292fd23d22345602f/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wMi0xNlQwNzozMzo1NloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "bm/2gRY/6Zr1OTMyApAeNhUF+aA=",
        "Content-Type": null
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1275"
        }
      }
    }
  },
  "included": [
    {
      "id": "1275",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user129@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:33:56.000+01:00",
        "last_seen_at": "2018-02-15T22:33:56.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1760"
          }
        }
      }
    },
    {
      "id": "1760",
      "type": "companies",
      "attributes": {
        "name": "Organization69",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:33:56.260+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/attachments

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "attachments",
    "attributes": {
      "attachable_type": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    }
  ]
}

Create a attachment
POST/api/v2/attachments


PATCH /api/v2/attachments/1
Requestsupdates attachmentreturns error

PATCH  /api/v2/attachments/13

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "attachments",
    "attributes": {
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/013/original/img.png?1518730437",
      "thumb": "/system/attachments/files/000/000/013/thumb/img.png?1518730437",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/205e9e3c4e8712e01eae84d94c4eac82/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wMi0xNlQwNzozMzo1N1oiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "srA1Muj7dhQ/W875fQZs/T3MvRE=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1277"
        }
      }
    }
  },
  "included": [
    {
      "id": "1277",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user131@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:33:57.000+01:00",
        "last_seen_at": "2018-02-15T22:33:57.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1764"
          }
        }
      }
    },
    {
      "id": "1764",
      "type": "companies",
      "attributes": {
        "name": "Organization71",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:33:57.008+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/attachments/14

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "attachments",
    "attributes": {
      "attachable_type": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    }
  ]
}

Update a attachment
PATCH/api/v2/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id


DELETE /api/v2/attachments/1
Requestsdeletes attachment

DELETE  /api/v2/attachments/15

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a attachment
DELETE/api/v2/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id


Billability Reports

Billability Reports

Supported filter params

  • person_id

  • service_type_id

  • tags

  • after

  • before

GET /api/v2/billability_reports
Requestsreturns billability reports

GET  /api/v2/billability_reports?filter[person_id]=1281

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "billability-report-person-1281",
      "type": "billability_reports",
      "attributes": {
        "group": "person",
        "internal_time": 0,
        "client_time": 480
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "1281"
          }
        },
        "service_type": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1281",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user135@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:33:58.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1771"
          }
        }
      }
    },
    {
      "id": "1771",
      "type": "companies",
      "attributes": {
        "name": "Client99",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:58.320+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/billability_reports?filter%5Bperson_id%5D=1281&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/billability_reports?filter%5Bperson_id%5D=1281&page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get billability reports
GET/api/v2/billability_reports


Boards

Boards

Supported filter params

  • project_id
GET /api/v2/boards
Requestsreturns boards

GET  /api/v2/boards?filter[project_id]=297

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "112",
      "type": "boards",
      "attributes": {
        "name": "board name",
        "position": 1,
        "archived_at": null
      },
      "relationships": {
        "project": {
          "data": {
            "type": "projects",
            "id": "297"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "297",
      "type": "projects",
      "attributes": {
        "name": "test project",
        "project_type_id": 2,
        "last_activity_at": null,
        "public_access": true,
        "time_on_tasks": false,
        "tag_colors": {},
        "archived_at": null,
        "board_count": 1,
        "budget_count": 0,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "ongoing_contract_count": 0,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1776"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1284"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1776",
      "type": "companies",
      "attributes": {
        "name": "Client103",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:59.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1284",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user138@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:33:58.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1775"
          }
        }
      }
    },
    {
      "id": "1775",
      "type": "companies",
      "attributes": {
        "name": "Client102",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:58.982+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/boards?filter%5Bproject_id%5D=297&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/boards?filter%5Bproject_id%5D=297&page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get boards
GET/api/v2/boards


GET /api/v2/boards/1
Requestsreturns board

GET  /api/v2/boards/113

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "113",
    "type": "boards",
    "attributes": {
      "name": "board name",
      "position": 1,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "298"
        }
      }
    }
  },
  "included": [
    {
      "id": "298",
      "type": "projects",
      "attributes": {
        "name": "test project",
        "project_type_id": 2,
        "last_activity_at": null,
        "public_access": true,
        "time_on_tasks": false,
        "tag_colors": {},
        "archived_at": null,
        "board_count": 1,
        "budget_count": 0,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "ongoing_contract_count": 0,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1779"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1286"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1779",
      "type": "companies",
      "attributes": {
        "name": "Client105",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:59.527+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1286",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user140@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:33:59.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1778"
          }
        }
      }
    },
    {
      "id": "1778",
      "type": "companies",
      "attributes": {
        "name": "Client104",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:59.513+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a board
GET/api/v2/boards/{id}

URI Parameters
HideShow
id
number (required) Example: 1

board id


POST /api/v2/boards
Requestscreates boardreturns error

POST  /api/v2/boards

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "boards",
    "attributes": {
      "name": "test name"
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "299"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "115",
    "type": "boards",
    "attributes": {
      "name": "test name",
      "position": 2,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "299"
        }
      }
    }
  },
  "included": [
    {
      "id": "299",
      "type": "projects",
      "attributes": {
        "name": "test project",
        "project_type_id": 2,
        "last_activity_at": null,
        "public_access": true,
        "time_on_tasks": false,
        "tag_colors": {},
        "archived_at": null,
        "board_count": 2,
        "budget_count": 0,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "ongoing_contract_count": 0,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1782"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1288"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1782",
      "type": "companies",
      "attributes": {
        "name": "Client107",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:59.968+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1288",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user142@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:33:59.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1781"
          }
        }
      }
    },
    {
      "id": "1781",
      "type": "companies",
      "attributes": {
        "name": "Client106",
        "default_currency": null,
        "created_at": "2018-02-15T22:33:59.955+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/boards

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "boards",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Create a board
POST/api/v2/boards


PATCH /api/v2/boards/1
Requestsupdates boardreturns error

PATCH  /api/v2/boards/118

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "boards",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "118",
    "type": "boards",
    "attributes": {
      "name": "new name",
      "position": 1,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "302"
        }
      }
    }
  },
  "included": [
    {
      "id": "302",
      "type": "projects",
      "attributes": {
        "name": "test project",
        "project_type_id": 2,
        "last_activity_at": null,
        "public_access": true,
        "time_on_tasks": false,
        "tag_colors": {},
        "archived_at": null,
        "board_count": 1,
        "budget_count": 0,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "ongoing_contract_count": 0,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1791"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1294"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1791",
      "type": "companies",
      "attributes": {
        "name": "Client113",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:01.250+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1294",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user148@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:01.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1790"
          }
        }
      }
    },
    {
      "id": "1790",
      "type": "companies",
      "attributes": {
        "name": "Client112",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:01.237+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/boards/119

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "boards",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a board
PATCH/api/v2/boards/{id}

URI Parameters
HideShow
id
number (required) Example: 1

board id


PATCH /api/v2/boards/1/archive
Requestsarchives board

PATCH  /api/v2/boards/121/archive

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "121",
    "type": "boards",
    "attributes": {
      "name": "board name",
      "position": null,
      "archived_at": "2018-02-15T21:34:02.760Z"
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "305"
        }
      }
    }
  },
  "included": [
    {
      "id": "305",
      "type": "projects",
      "attributes": {
        "name": "test project",
        "project_type_id": 2,
        "last_activity_at": null,
        "public_access": true,
        "time_on_tasks": false,
        "tag_colors": {},
        "archived_at": null,
        "board_count": 0,
        "budget_count": 0,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "ongoing_contract_count": 0,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1800"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1300"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1800",
      "type": "companies",
      "attributes": {
        "name": "Client119",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:02.498+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1300",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user154@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:02.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1799"
          }
        }
      }
    },
    {
      "id": "1799",
      "type": "companies",
      "attributes": {
        "name": "Client118",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:02.485+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Archives a board
PATCH/api/v2/boards/{id}/archive

URI Parameters
HideShow
id
number (required) Example: 1

board id


PATCH /api/v2/boards/1/restore
Requestsrestores board

PATCH  /api/v2/boards/122/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "122",
    "type": "boards",
    "attributes": {
      "name": "Board11",
      "position": 2,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "306"
        }
      }
    }
  },
  "included": [
    {
      "id": "306",
      "type": "projects",
      "attributes": {
        "name": "test project",
        "project_type_id": 2,
        "last_activity_at": null,
        "public_access": true,
        "time_on_tasks": false,
        "tag_colors": {},
        "archived_at": null,
        "board_count": 1,
        "budget_count": 0,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "ongoing_contract_count": 0,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1803"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1302"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1803",
      "type": "companies",
      "attributes": {
        "name": "Client121",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:03.066+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1302",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user156@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:03.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1802"
          }
        }
      }
    },
    {
      "id": "1802",
      "type": "companies",
      "attributes": {
        "name": "Client120",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:03.050+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Restores a board
PATCH/api/v2/boards/{id}/restore

URI Parameters
HideShow
id
number (required) Example: 1

board id


Bookings

Bookings

Supported filter params

  • person_id
GET /api/v2/bookings
Requestsreturns bookings

GET  /api/v2/bookings

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "9",
      "type": "bookings",
      "attributes": {
        "hours": 6,
        "started_on": "2018-02-15",
        "ended_on": "2018-02-15",
        "note": null,
        "total_hours": 6,
        "created_at": "2018-02-15T22:34:03.630+01:00",
        "updated_at": "2018-02-15T22:34:03.630+01:00"
      },
      "relationships": {
        "service": {
          "data": null
        },
        "event": {
          "data": {
            "type": "events",
            "id": "8"
          }
        },
        "person": {
          "data": {
            "type": "people",
            "id": "1304"
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "1303"
          }
        },
        "updater": {
          "data": {
            "type": "people",
            "id": "1303"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "8",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 569
          }
        }
      }
    },
    {
      "id": "1304",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user158@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:03.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1805"
          }
        }
      }
    },
    {
      "id": "1303",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user157@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:03.000+01:00",
        "last_seen_at": "2018-02-15T22:34:03.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1804"
          }
        }
      }
    },
    {
      "id": "1805",
      "type": "companies",
      "attributes": {
        "name": "Client122",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:03.574+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1804",
      "type": "companies",
      "attributes": {
        "name": "Organization85",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:03.449+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/bookings?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/bookings?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get bookings
GET/api/v2/bookings


GET /api/v2/bookings/1
Requestsreturns booking

GET  /api/v2/bookings/10

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "10",
    "type": "bookings",
    "attributes": {
      "hours": 6,
      "started_on": "2018-02-15",
      "ended_on": "2018-02-15",
      "note": null,
      "total_hours": 6,
      "created_at": "2018-02-15T22:34:03.935+01:00",
      "updated_at": "2018-02-15T22:34:03.935+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "9"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1306"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1305"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1305"
        }
      }
    }
  },
  "included": [
    {
      "id": "9",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 570
          }
        }
      }
    },
    {
      "id": "1306",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user160@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:03.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1807"
          }
        }
      }
    },
    {
      "id": "1305",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user159@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:03.000+01:00",
        "last_seen_at": "2018-02-15T22:34:03.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1806"
          }
        }
      }
    },
    {
      "id": "1807",
      "type": "companies",
      "attributes": {
        "name": "Client123",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:03.916+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1806",
      "type": "companies",
      "attributes": {
        "name": "Organization86",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:03.796+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a booking
GET/api/v2/bookings/{id}

URI Parameters
HideShow
id
number (required) Example: 1

booking id


POST /api/v2/bookings
Requestscreates the bookingreturns error

POST  /api/v2/bookings

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bookings",
    "attributes": {
      "started_on": "Feb 15, 2018",
      "ended_on": "Feb 15, 2018",
      "hours": "6"
    },
    "relationships": {
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1308"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "bookings",
    "attributes": {
      "hours": 6,
      "started_on": "2018-02-15",
      "ended_on": "2018-02-15",
      "note": null,
      "total_hours": 6,
      "created_at": "2018-02-15T22:34:04.295+01:00",
      "updated_at": "2018-02-15T22:34:04.295+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1308"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1307"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1307"
        }
      }
    }
  },
  "included": [
    {
      "id": "10",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 571
          }
        }
      }
    },
    {
      "id": "1308",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user162@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:04.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1809"
          }
        }
      }
    },
    {
      "id": "1307",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user161@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:04.000+01:00",
        "last_seen_at": "2018-02-15T22:34:04.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1808"
          }
        }
      }
    },
    {
      "id": "1809",
      "type": "companies",
      "attributes": {
        "name": "Client124",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:04.175+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1808",
      "type": "companies",
      "attributes": {
        "name": "Organization87",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:04.054+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/bookings

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bookings",
    "attributes": {
      "hours": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/person"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/started_on"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not a date",
      "source": {
        "pointer": "data/attributes/started_on"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/ended_on"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not a date",
      "source": {
        "pointer": "data/attributes/ended_on"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/hours"
      }
    }
  ]
}

Create a booking
POST/api/v2/bookings


PATCH /api/v2/bookings/1
Requestsupdates bookingreturnes error

PATCH  /api/v2/bookings/14

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bookings",
    "attributes": {
      "hours": "2"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "bookings",
    "attributes": {
      "hours": 2,
      "started_on": "2018-02-15",
      "ended_on": "2018-02-15",
      "note": null,
      "total_hours": 2,
      "created_at": "2018-02-15T22:34:04.745+01:00",
      "updated_at": "2018-02-15T22:34:04.798+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "12"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1312"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1311"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1311"
        }
      }
    }
  },
  "included": [
    {
      "id": "12",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 573
          }
        }
      }
    },
    {
      "id": "1312",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user166@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:04.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1813"
          }
        }
      }
    },
    {
      "id": "1311",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user165@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:04.000+01:00",
        "last_seen_at": "2018-02-15T22:34:04.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1812"
          }
        }
      }
    },
    {
      "id": "1813",
      "type": "companies",
      "attributes": {
        "name": "Client126",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:04.728+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1812",
      "type": "companies",
      "attributes": {
        "name": "Organization89",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:04.618+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/bookings/15

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bookings",
    "attributes": {
      "hours": null
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/hours"
      }
    }
  ]
}

Update a booking
PATCH/api/v2/bookings/{id}

URI Parameters
HideShow
id
number (required) Example: 1

booking id


DELETE /api/v2/bookings/1
Requestsdeletes booking

DELETE  /api/v2/bookings/16

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a booking
DELETE/api/v2/bookings/{id}

URI Parameters
HideShow
id
number (required) Example: 1

booking id


Comments

Comments

GET /api/v2/comments/1
Requestsreturns comment

GET  /api/v2/comments/28

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "28",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2018-02-15T22:34:05.424+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1317"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1819"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1317",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user171@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:05.000+01:00",
        "last_seen_at": "2018-02-15T22:34:05.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1818"
          }
        }
      }
    },
    {
      "id": "1819",
      "type": "companies",
      "attributes": {
        "name": "Client129",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:05.419+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1818",
      "type": "companies",
      "attributes": {
        "name": "Organization92",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:05.321+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a comment
GET/api/v2/comments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

comment id


POST /api/v2/comments
Requestscreates staged commentreturns error

POST  /api/v2/comments

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "commentable_type": "task"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "30",
    "type": "comments",
    "attributes": {
      "commentable_type": "task",
      "body": null,
      "created_at": "2018-02-15T22:34:05.695+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1318"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": null
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1318",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user172@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:05.000+01:00",
        "last_seen_at": "2018-02-15T22:34:05.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1820"
          }
        }
      }
    },
    {
      "id": "1820",
      "type": "companies",
      "attributes": {
        "name": "Organization93",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:05.536+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/comments

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "commentable_type": "invalid"
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/commentable_type"
      }
    }
  ]
}

Create a comment
POST/api/v2/comments


PATCH /api/v2/comments/1
Requestsupdates comment

PATCH  /api/v2/comments/32

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "body": "new body"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "32",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "new body",
      "created_at": "2018-02-15T22:34:06.039+01:00",
      "pinned_at": null,
      "edited_at": "2018-02-15T22:34:06.117+01:00",
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1320"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1825"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1320",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user174@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:06.000+01:00",
        "last_seen_at": "2018-02-15T22:34:06.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1824"
          }
        }
      }
    },
    {
      "id": "1825",
      "type": "companies",
      "attributes": {
        "name": "Client132",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:06.034+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1824",
      "type": "companies",
      "attributes": {
        "name": "Organization95",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:05.933+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Update a comment
PATCH/api/v2/comments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

comment id


PATCH /api/v2/comments/1/pin
Requestspins the commentdoes not pin the comment

PATCH  /api/v2/comments/34/pin

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "34",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2018-02-15T22:34:06.584+01:00",
      "pinned_at": "2018-02-15T22:34:06.601+01:00",
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1322"
        }
      },
      "pinned_by": {
        "data": {
          "type": "people",
          "id": "1322"
        }
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1829"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1322",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user176@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:06.000+01:00",
        "last_seen_at": "2018-02-15T22:34:06.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1828"
          }
        }
      }
    },
    {
      "id": "1829",
      "type": "companies",
      "attributes": {
        "name": "Client134",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:06.579+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1828",
      "type": "companies",
      "attributes": {
        "name": "Organization97",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:06.479+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/comments/35/pin

Headers
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 403,
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource"
    }
  ]
}

Pins a comment
PATCH/api/v2/comments/{id}/pin

URI Parameters
HideShow
id
number (required) Example: 1

comment id


PATCH /api/v2/comments/1/unpin
Requestsunpins the commentdoes not unpin the comment

PATCH  /api/v2/comments/36/unpin

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "36",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2018-02-15T22:34:06.997+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1324"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1833"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1324",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user178@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:07.000+01:00",
        "last_seen_at": "2018-02-15T22:34:07.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1832"
          }
        }
      }
    },
    {
      "id": "1833",
      "type": "companies",
      "attributes": {
        "name": "Client136",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:06.992+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1832",
      "type": "companies",
      "attributes": {
        "name": "Organization99",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:06.863+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/comments/37/unpin

Headers
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 403,
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource"
    }
  ]
}

Unpins a comment
PATCH/api/v2/comments/{id}/unpin

URI Parameters
HideShow
id
number (required) Example: 1

comment id


DELETE /api/v2/comments/1
Requestsarchives comment

DELETE  /api/v2/comments/38

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a comment
DELETE/api/v2/comments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

comment id


Companies

Companies

Supported filter params

  • status

  • tags

  • query

GET /api/v2/companies
Requestsreturns companies

GET  /api/v2/companies

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1839",
      "type": "companies",
      "attributes": {
        "name": "Client139",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:07.544+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1838",
      "type": "companies",
      "attributes": {
        "name": "Organization102",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:07.445+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 2,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get companies
GET/api/v2/companies


GET /api/v2/companies/1
Requestsreturns company

GET  /api/v2/companies/1841

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1841",
    "type": "companies",
    "attributes": {
      "name": "Client140",
      "default_currency": null,
      "created_at": "2018-02-15T22:34:07.714+01:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

Gets a company
GET/api/v2/companies/{id}

URI Parameters
HideShow
id
number (required) Example: 1

company id


POST /api/v2/companies
Requestscreates companyreturns error

POST  /api/v2/companies

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "companies",
    "attributes": {
      "name": "test name"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1844",
    "type": "companies",
    "attributes": {
      "name": "test name",
      "default_currency": null,
      "created_at": "2018-02-15T22:34:07.978+01:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

POST  /api/v2/companies

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "companies",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Create a company
POST/api/v2/companies


PATCH /api/v2/companies/1
Requestsupdates companyreturns error

PATCH  /api/v2/companies/1848

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "companies",
    "attributes": {
      "name": "new name",
      "tag_list": [
        "design",
        "IT"
      ]
    },
    "relationships": {
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "1332"
          },
          {
            "type": "people",
            "id": "1333"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1848",
    "type": "companies",
    "attributes": {
      "name": "new name",
      "default_currency": null,
      "created_at": "2018-02-15T22:34:08.336+01:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": [
        "design",
        "IT"
      ]
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/companies/1852

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "companies",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a company
PATCH/api/v2/companies/{id}

URI Parameters
HideShow
id
number (required) Example: 1

company id


PATCH /api/v2/companies/1/archive
Requestsarchives companyreturns error

PATCH  /api/v2/companies/1854/archive

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1854",
    "type": "companies",
    "attributes": {
      "name": "Client147",
      "default_currency": null,
      "created_at": "2018-02-15T22:34:09.121+01:00",
      "archived_at": "2018-02-15T22:34:09.000+01:00",
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/companies/1856/archive

Headers
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 403,
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource"
    }
  ]
}

Archives a company
PATCH/api/v2/companies/{id}/archive

URI Parameters
HideShow
id
number (required) Example: 1

company id


PATCH /api/v2/companies/1/restore
Requestsreturns errorrestores company

PATCH  /api/v2/companies/1858/restore

Headers
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 403,
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource"
    }
  ]
}

PATCH  /api/v2/companies/1860/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1860",
    "type": "companies",
    "attributes": {
      "name": "Client150",
      "default_currency": null,
      "created_at": "2018-02-15T22:34:09.586+01:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

Restores a company
PATCH/api/v2/companies/{id}/restore

URI Parameters
HideShow
id
number (required) Example: 1

company id


Contact Entries

Contact Entries

Supported filter params

  • person_id

  • company_id

GET /api/v2/contact_entries
Requestsreturns contact entries

GET  /api/v2/contact_entries

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "59",
      "type": "contact_entries",
      "attributes": {
        "contactable_type": "company",
        "type": "email",
        "name": "Personal",
        "email": "contact1@email.com",
        "phone": null,
        "website": null,
        "address": null,
        "city": null,
        "state": null,
        "zipcode": null,
        "country": null,
        "vat": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1862"
          }
        },
        "person": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "subsidiary": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1862",
      "type": "companies",
      "attributes": {
        "name": "Client151",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:09.780+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get contact entries
GET/api/v2/contact_entries


GET /api/v2/contact_entries/1
Requestsreturns contact_entry

GET  /api/v2/contact_entries/60

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "60",
    "type": "contact_entries",
    "attributes": {
      "contactable_type": "company",
      "type": "email",
      "name": "Personal",
      "email": "contact2@email.com",
      "phone": null,
      "website": null,
      "address": null,
      "city": null,
      "state": null,
      "zipcode": null,
      "country": null,
      "vat": null
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1864"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1864",
      "type": "companies",
      "attributes": {
        "name": "Client152",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:09.979+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a contact entry
GET/api/v2/contact_entries/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contact entry id


POST /api/v2/contact_entries
Requestscreates contact_entryreturns error

POST  /api/v2/contact_entries

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contact_entries",
    "attributes": {
      "contactable_type": "company",
      "type": "email",
      "name": "Work",
      "email": "contact@email.com"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1866"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "62",
    "type": "contact_entries",
    "attributes": {
      "contactable_type": "company",
      "type": "email",
      "name": "Work",
      "email": "contact@email.com",
      "phone": null,
      "website": null,
      "address": null,
      "city": null,
      "state": null,
      "zipcode": null,
      "country": null,
      "vat": null
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1866"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1866",
      "type": "companies",
      "attributes": {
        "name": "Client153",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:10.155+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/contact_entries

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contact_entries",
    "attributes": {
      "type": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/contactable_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/contactable_type"
      }
    }
  ]
}

Create a contact entry
POST/api/v2/contact_entries


PATCH /api/v2/contact_entries/1
Requestsupdates contact_entryreturns error

PATCH  /api/v2/contact_entries/71

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contact_entries",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "71",
    "type": "contact_entries",
    "attributes": {
      "contactable_type": "company",
      "type": "email",
      "name": "new name",
      "email": "contact9@email.com",
      "phone": null,
      "website": null,
      "address": null,
      "city": null,
      "state": null,
      "zipcode": null,
      "country": null,
      "vat": null
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1879"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1879",
      "type": "companies",
      "attributes": {
        "name": "Client160",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:11.988+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/contact_entries/72

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contact_entries",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a contact entry
PATCH/api/v2/contact_entries/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contact entry id


DELETE /api/v2/contact_entries/1
Requestsdeletes contact_entry

DELETE  /api/v2/contact_entries/74

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a contact entry
DELETE/api/v2/contact_entries/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contact entry id


Contracts

Contracts

GET /api/v2/contracts
Requestsreturns contracts

GET  /api/v2/contracts

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "13",
      "type": "contracts",
      "attributes": {
        "ends_on": null,
        "next_occurrence_on": "2017-02-01",
        "interval_id": 1
      },
      "relationships": {
        "template": {
          "data": {
            "type": "deals",
            "id": "161"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "161",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:13.024+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1354"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1890"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1355"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1294"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1354",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user208@email.com",
        "title": null,
        "joined_at": "2017-01-01T15:00:00.000+01:00",
        "last_seen_at": "2017-01-01T15:00:00.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1889"
          }
        }
      }
    },
    {
      "id": "1890",
      "type": "companies",
      "attributes": {
        "name": "Client166",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:12.977+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1355",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user209@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:12.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1891"
          }
        }
      }
    },
    {
      "id": "1294",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "1889",
      "type": "companies",
      "attributes": {
        "name": "Organization125",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:12.852+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1891",
      "type": "companies",
      "attributes": {
        "name": "Client167",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:12.991+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get contracts
GET/api/v2/contracts


GET /api/v2/contracts/1
Requestsreturns contract

GET  /api/v2/contracts/14

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "162"
        }
      }
    }
  },
  "included": [
    {
      "id": "162",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:13.435+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1356"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1893"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1357"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1297"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1356",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user210@email.com",
        "title": null,
        "joined_at": "2017-01-01T15:00:00.000+01:00",
        "last_seen_at": "2017-01-01T15:00:00.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1892"
          }
        }
      }
    },
    {
      "id": "1893",
      "type": "companies",
      "attributes": {
        "name": "Client168",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:13.366+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1357",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user211@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:13.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1894"
          }
        }
      }
    },
    {
      "id": "1297",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 610
          }
        }
      }
    },
    {
      "id": "1892",
      "type": "companies",
      "attributes": {
        "name": "Organization126",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:13.254+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1894",
      "type": "companies",
      "attributes": {
        "name": "Client169",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:13.387+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a contract
GET/api/v2/contracts/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contract id


POST /api/v2/contracts
Requestscreates contract and starts recurringreturns error

POST  /api/v2/contracts

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contracts",
    "attributes": {
      "interval_id": "1",
      "next_occurrence_on": "01.02.2017"
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "164"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "16",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "166"
        }
      }
    }
  },
  "included": [
    {
      "id": "164",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-01-01",
        "end_date": "2017-01-31",
        "number": 2,
        "suffix": "2017/01",
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1358"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1898"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1360"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": {
            "type": "contracts",
            "id": "16"
          }
        }
      }
    },
    {
      "id": "1358",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user212@email.com",
        "title": null,
        "joined_at": "2017-01-01T15:00:00.000+01:00",
        "last_seen_at": "2017-01-01T15:00:00.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1895"
          }
        }
      }
    },
    {
      "id": "1898",
      "type": "companies",
      "attributes": {
        "name": "Client172",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1360",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user214@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-01-01T15:00:00.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1899"
          }
        }
      }
    },
    {
      "id": "1895",
      "type": "companies",
      "attributes": {
        "name": "Organization127",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:13.628+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1899",
      "type": "companies",
      "attributes": {
        "name": "Client173",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/contracts

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contracts",
    "attributes": {
      "interval_id": "1",
      "next_occurrence_on": "2017-02-01"
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "0"
        }
      }
    }
  }
}
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 403,
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource"
    }
  ]
}

Create a contract
POST/api/v2/contracts


PATCH /api/v2/contracts/1
Requestsupdates contractreturns error

PATCH  /api/v2/contracts/20

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contracts",
    "attributes": {
      "ends_on": "31.12.2017"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "20",
    "type": "contracts",
    "attributes": {
      "ends_on": "2017-12-31",
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "171"
        }
      }
    }
  },
  "included": [
    {
      "id": "169",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:15.111+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1368"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1912"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1369"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1313"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1368",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user222@email.com",
        "title": null,
        "joined_at": "2017-01-01T15:00:00.000+01:00",
        "last_seen_at": "2017-01-01T15:00:00.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1911"
          }
        }
      }
    },
    {
      "id": "1912",
      "type": "companies",
      "attributes": {
        "name": "Client182",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:15.069+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1369",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user223@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:15.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1913"
          }
        }
      }
    },
    {
      "id": "1313",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 615
          }
        }
      }
    },
    {
      "id": "1911",
      "type": "companies",
      "attributes": {
        "name": "Organization131",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:14.974+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1913",
      "type": "companies",
      "attributes": {
        "name": "Client183",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:15.080+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/contracts/21

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "contracts",
    "attributes": {
      "next_occurrence_on": "2016-12-29"
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "must be after today",
      "source": {
        "pointer": "data/attributes/next_occurrence_on"
      }
    }
  ]
}

Update a contract
PATCH/api/v2/contracts/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contract id


Dashboards

Dashboards

GET /api/v2/dashboards
Requestsreturns dashboards

GET  /api/v2/dashboards

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "13",
      "type": "dashboards",
      "attributes": {
        "name": "dashboard_name"
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "1379"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1379",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user233@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:16.000+01:00",
        "last_seen_at": "2018-02-15T22:34:16.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1929"
          }
        }
      }
    },
    {
      "id": "1929",
      "type": "companies",
      "attributes": {
        "name": "Organization135",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:16.178+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get dashboards
GET/api/v2/dashboards


POST /api/v2/dashboards
Requestscreates the dashboardreturns error

POST  /api/v2/dashboards

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "dashboards",
    "attributes": {
      "name": "Test Name"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "type": "dashboards",
    "attributes": {
      "name": "Test Name"
    },
    "relationships": {
      "person": {
        "data": {
          "type": "people",
          "id": "1380"
        }
      }
    }
  },
  "included": [
    {
      "id": "1380",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user234@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:16.000+01:00",
        "last_seen_at": "2018-02-15T22:34:16.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1931"
          }
        }
      }
    },
    {
      "id": "1931",
      "type": "companies",
      "attributes": {
        "name": "Organization137",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:16.479+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/dashboards

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "dashboards",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Create a dashboard
POST/api/v2/dashboards


PATCH /api/v2/dashboards/1
Requestsupdats dashboardreturnes error

PATCH  /api/v2/dashboards/17

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "dashboard",
    "attributes": {
      "name": "dashboard rename"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "type": "dashboards",
    "attributes": {
      "name": "dashboard rename"
    },
    "relationships": {
      "person": {
        "data": {
          "type": "people",
          "id": "1382"
        }
      }
    }
  },
  "included": [
    {
      "id": "1382",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user236@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:17.000+01:00",
        "last_seen_at": "2018-02-15T22:34:17.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1935"
          }
        }
      }
    },
    {
      "id": "1935",
      "type": "companies",
      "attributes": {
        "name": "Organization141",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:17.087+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/dashboards/18

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "dashboards",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a dashboard
PATCH/api/v2/dashboards/{id}

URI Parameters
HideShow
id
number (required) Example: 1

dashboard id


DELETE /api/v2/dashboards/1
Requestsdeletes dashboard

DELETE  /api/v2/dashboards/19

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a dashboard
DELETE/api/v2/dashboards/{id}

URI Parameters
HideShow
id
number (required) Example: 1

dashboard id


Deal Statuses

Deal Statuses

Supported filter params

  • stage_id
GET /api/v2/deal_statuses
Requestsreturns deal statuses

GET  /api/v2/deal_statuses

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1347",
      "type": "deal_statuses",
      "attributes": {
        "name": "Opportunity",
        "position": 1
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 631
          }
        }
      }
    },
    {
      "id": "1348",
      "type": "deal_statuses",
      "attributes": {
        "name": "Proposal sent",
        "position": 2
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 631
          }
        }
      }
    },
    {
      "id": "1349",
      "type": "deal_statuses",
      "attributes": {
        "name": "test deal status",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 631
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get deal statuses
GET/api/v2/deal_statuses


GET /api/v2/deal_statuses/1
Requestsreturns deal status

GET  /api/v2/deal_statuses/1352

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1352",
    "type": "deal_statuses",
    "attributes": {
      "name": "test deal status",
      "position": 3
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 632
        }
      }
    }
  }
}

Gets a deal status
GET/api/v2/deal_statuses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal status id


POST /api/v2/deal_statuses
Requestscreates deal statusreturns error

POST  /api/v2/deal_statuses

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deal_statuses",
    "attributes": {
      "name": "test name"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1356",
    "type": "deal_statuses",
    "attributes": {
      "name": "test name",
      "position": 4
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 633
        }
      }
    }
  }
}

POST  /api/v2/deal_statuses

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deal_statuses",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Create a deal status
POST/api/v2/deal_statuses


PATCH /api/v2/deal_statuses/1
Requestsupdates deal_statusreturns error

PATCH  /api/v2/deal_statuses/1362

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deal_statuses",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1362",
    "type": "deal_statuses",
    "attributes": {
      "name": "new name",
      "position": 3
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 635
        }
      }
    }
  }
}

PATCH  /api/v2/deal_statuses/1365

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deal_statuses",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a deal status
PATCH/api/v2/deal_statuses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal status id


DELETE /api/v2/deal_statuses/1
Requestsdeletes deal_statusreturns error

DELETE  /api/v2/deal_statuses/1368

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

DELETE  /api/v2/deal_statuses/1371

Headers
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 403,
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource"
    }
  ]
}

Deletes a deal status
DELETE/api/v2/deal_statuses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal status id


Deals

Deals

Supported filter params

  • responsible_id

  • company_id

  • status_id

  • sales_status_id

  • stage_id

  • contract_id

  • recurring

  • project_id

  • tags

  • query

GET /api/v2/deals
Requestsreturns deals

GET  /api/v2/deals

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "178",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:19.863+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1397"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1956"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1398"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1382"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1397",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user251@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:19.000+01:00",
        "last_seen_at": "2018-02-15T22:34:19.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1955"
          }
        }
      }
    },
    {
      "id": "1956",
      "type": "companies",
      "attributes": {
        "name": "Client200",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:19.821+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1398",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user252@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:19.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1957"
          }
        }
      }
    },
    {
      "id": "1382",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 641
          }
        }
      }
    },
    {
      "id": "1955",
      "type": "companies",
      "attributes": {
        "name": "Organization157",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:19.718+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1957",
      "type": "companies",
      "attributes": {
        "name": "Client201",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:19.834+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get deals
GET/api/v2/deals


GET /api/v2/deals/1
Requestsreturns deal

GET  /api/v2/deals/179

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "179",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-02-15",
      "end_date": null,
      "number": 1,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": false,
      "sales_status_id": 1,
      "sales_status_updated_at": null,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2018-02-15T22:34:20.170+01:00",
      "note": null,
      "note_interpolated": null,
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1399"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1959"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1400"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "1385"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1399",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user253@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:20.000+01:00",
        "last_seen_at": "2018-02-15T22:34:20.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1958"
          }
        }
      }
    },
    {
      "id": "1959",
      "type": "companies",
      "attributes": {
        "name": "Client202",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:20.126+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1400",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user254@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:20.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1960"
          }
        }
      }
    },
    {
      "id": "1385",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 642
          }
        }
      }
    },
    {
      "id": "1958",
      "type": "companies",
      "attributes": {
        "name": "Organization158",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:20.027+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1960",
      "type": "companies",
      "attributes": {
        "name": "Client203",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:20.139+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a deal
GET/api/v2/deals/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal id


POST /api/v2/deals
Requestscreates dealreturns error

POST  /api/v2/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "Feb 15, 2018",
      "deal_type_id": "2",
      "deal_status_id": "1388",
      "sales_status_id": "1",
      "probability": "50",
      "currency": "EUR"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1962"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1403"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "181",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-02-15",
      "end_date": null,
      "number": 2,
      "suffix": null,
      "time_approval": false,
      "client_access": false,
      "deal_type_id": 2,
      "budget": false,
      "sales_status_id": 1,
      "sales_status_updated_at": "2018-02-15T22:34:20.000+01:00",
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2018-02-15T22:34:20.572+01:00",
      "note": null,
      "note_interpolated": null,
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1401"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1962"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1403"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "1388"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1401",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user255@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:20.000+01:00",
        "last_seen_at": "2018-02-15T22:34:20.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1961"
          }
        }
      }
    },
    {
      "id": "1962",
      "type": "companies",
      "attributes": {
        "name": "Client204",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:20.411+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1403",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user257@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2018-02-15T22:34:20.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1964"
          }
        }
      }
    },
    {
      "id": "1388",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 643
          }
        }
      }
    },
    {
      "id": "1961",
      "type": "companies",
      "attributes": {
        "name": "Organization159",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:20.310+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1964",
      "type": "companies",
      "attributes": {
        "name": "Client206",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:20.478+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deals",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/date"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not a date",
      "source": {
        "pointer": "data/attributes/date"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/responsible"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/company"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/deal_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/probability"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not an valid currency",
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/deal_status"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/sales_status"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/sales_status"
      }
    }
  ]
}

Create a deal
POST/api/v2/deals


PATCH /api/v2/deals/1
Requestsupdates dealreturns error

PATCH  /api/v2/deals/184

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deals",
    "attributes": {
      "name": "new name",
      "tag_list": [
        "invoiced",
        "paid"
      ]
    },
    "relationships": {
      "responsible": {
        "data": {
          "type": "people",
          "id": "1410"
        }
      },
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "1411"
          },
          {
            "type": "people",
            "id": "1412"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "184",
    "type": "deals",
    "attributes": {
      "name": "new name",
      "date": "2018-02-15",
      "end_date": null,
      "number": 1,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": false,
      "sales_status_id": 1,
      "sales_status_updated_at": null,
      "tag_list": [
        "invoiced",
        "paid"
      ],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2018-02-15T22:34:21.520+01:00",
      "note": null,
      "note_interpolated": null,
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1408"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1972"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1410"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "1397"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1408",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user262@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:21.000+01:00",
        "last_seen_at": "2018-02-15T22:34:21.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1971"
          }
        }
      }
    },
    {
      "id": "1972",
      "type": "companies",
      "attributes": {
        "name": "Client211",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:21.479+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1410",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user264@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2018-02-15T22:34:21.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1974"
          }
        }
      }
    },
    {
      "id": "1397",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 646
          }
        }
      }
    },
    {
      "id": "1971",
      "type": "companies",
      "attributes": {
        "name": "Organization162",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:21.346+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1974",
      "type": "companies",
      "attributes": {
        "name": "Client213",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:21.545+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/deals/185

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deals",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a deal
PATCH/api/v2/deals/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal id


DELETE /api/v2/deals/1
Requestsarchives deal

DELETE  /api/v2/deals/186

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a deal
DELETE/api/v2/deals/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal id


PATCH /api/v2/deals/1/open
Requestsopens budget

PATCH  /api/v2/deals/201/open

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "201",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-02-15",
      "end_date": null,
      "number": 2,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": true,
      "sales_status_id": null,
      "sales_status_updated_at": null,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2018-02-15T22:34:26.089+01:00",
      "note": null,
      "note_interpolated": null,
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1439"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2021"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1441"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1439",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user293@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:26.000+01:00",
        "last_seen_at": "2018-02-15T22:34:26.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2018"
          }
        }
      }
    },
    {
      "id": "2021",
      "type": "companies",
      "attributes": {
        "name": "Client250",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:26.043+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1441",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user295@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:26.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2022"
          }
        }
      }
    },
    {
      "id": "2018",
      "type": "companies",
      "attributes": {
        "name": "Organization172",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:25.878+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2022",
      "type": "companies",
      "attributes": {
        "name": "Client251",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:26.062+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Opens a deal
PATCH/api/v2/deals/{id}/open

URI Parameters
HideShow
id
number (required) Example: 1

deal id


PATCH /api/v2/deals/1/close
Requestscloses budget

PATCH  /api/v2/deals/203/close

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "203",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-02-15",
      "end_date": null,
      "number": 2,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": true,
      "sales_status_id": null,
      "sales_status_updated_at": null,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": "2018-02-15T22:34:26.490+01:00",
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2018-02-15T22:34:26.457+01:00",
      "note": null,
      "note_interpolated": null,
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1442"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2026"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1444"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1442",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user296@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:26.000+01:00",
        "last_seen_at": "2018-02-15T22:34:26.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2023"
          }
        }
      }
    },
    {
      "id": "2026",
      "type": "companies",
      "attributes": {
        "name": "Client254",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:26.419+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1444",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user298@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:26.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2027"
          }
        }
      }
    },
    {
      "id": "2023",
      "type": "companies",
      "attributes": {
        "name": "Organization173",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:26.261+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2027",
      "type": "companies",
      "attributes": {
        "name": "Client255",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:26.431+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Closes a deal
PATCH/api/v2/deals/{id}/close

URI Parameters
HideShow
id
number (required) Example: 1

deal id


Devices

Devices

POST /api/v2/devices
Requestscreates devicedeletes duplicate and creates devicedeletes duplicate and creates devicedeletes duplicate and creates devicereturns error

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "push_token": "push_token1",
      "unique_identifier": "unique_identifier1"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "9",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier1",
      "push_token": "push_token1",
      "firebase_token": null
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1139"
        }
      }
    }
  },
  "included": [
    {
      "id": "1139",
      "type": "users",
      "attributes": {
        "email": "user1@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 485,
        "default_organization_slug": "485-organization1",
        "intercom_hash": "14e3a6d7f7e2e40809ba4472f4d64eaf1af401a5ed3a9f6cb7051ed2078fb03a",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "push_token": "push_token2",
      "unique_identifier": "unique_identifier2"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier2",
      "push_token": "push_token2",
      "firebase_token": null
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1140"
        }
      }
    }
  },
  "included": [
    {
      "id": "1140",
      "type": "users",
      "attributes": {
        "email": "user2@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 486,
        "default_organization_slug": "486-organization2",
        "intercom_hash": "fea9f7e73970605fdae7c87db7915008fccc806aa0c2b9669e754911e1a32c9e",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "push_token": "push_token4",
      "unique_identifier": "unique_identifier3"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier3",
      "push_token": "push_token4",
      "firebase_token": null
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1141"
        }
      }
    }
  },
  "included": [
    {
      "id": "1141",
      "type": "users",
      "attributes": {
        "email": "user3@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 487,
        "default_organization_slug": "487-organization3",
        "intercom_hash": "d16aca1f36a0a03ba658e21841980d25dcd975c68238699fcbf6c3c69492ff53",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "push_token": null,
      "firebase_token": "firebasetoken",
      "unique_identifier": "unique_identifier5"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier5",
      "push_token": null,
      "firebase_token": "firebasetoken"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1143"
        }
      }
    }
  },
  "included": [
    {
      "id": "1143",
      "type": "users",
      "attributes": {
        "email": "user5@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 488,
        "default_organization_slug": "488-organization4",
        "intercom_hash": "ce061c7c4512e120faecb5af457d1ba38f935b7d70ca8af9097673f1ff7f205b",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "devices",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/unique_identifier"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/push_token"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/firebase_token"
      }
    }
  ]
}

Create a device
POST/api/v2/devices


DELETE /api/v2/devices/1
Requestsdeletes device

DELETE  /api/v2/devices/16

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a device
DELETE/api/v2/devices/{id}

URI Parameters
HideShow
id
number (required) Example: 1

device id


Document Types

Document Types

GET /api/v2/document_types
Requestsreturns document_types

GET  /api/v2/document_types

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "10",
      "type": "document_types",
      "attributes": {
        "name": "normal invoice",
        "tax1_name": "VAT",
        "tax1_value": 25,
        "locale": "en_US",
        "number": null,
        "document_template_id": 1,
        "exportable_type_id": 1,
        "note": null,
        "number_format": null,
        "footer": null,
        "template_options": {}
      },
      "relationships": {
        "subsidiary": {
          "data": {
            "type": "subsidiaries",
            "id": "33"
          }
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 658
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "33",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary2",
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 658
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get document_types
GET/api/v2/document_types


GET /api/v2/document_types/1
Requestsreturns document_type

GET  /api/v2/document_types/11

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "document_types",
    "attributes": {
      "name": "normal invoice",
      "tax1_name": "VAT",
      "tax1_value": 25,
      "locale": "en_US",
      "number": null,
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "number_format": null,
      "footer": null,
      "template_options": {}
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "34"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 659
        }
      }
    }
  },
  "included": [
    {
      "id": "34",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary3",
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 659
          }
        }
      }
    }
  ]
}

Gets a document_type
GET/api/v2/document_types/{id}

URI Parameters
HideShow
id
number (required) Example: 1

document type id


POST /api/v2/document_types
Requestscreates document_typereturns error

POST  /api/v2/document_types

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "locale": "hr_HR",
      "exportable_type_id": "1"
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "35"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "tax1_name": null,
      "tax1_value": null,
      "locale": "hr_HR",
      "number": null,
      "document_template_id": null,
      "exportable_type_id": 1,
      "note": null,
      "number_format": null,
      "footer": null,
      "template_options": {}
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "35"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 660
        }
      }
    }
  },
  "included": [
    {
      "id": "35",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary4",
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 660
          }
        }
      }
    }
  ]
}

POST  /api/v2/document_types

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/locale"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/subsidiary"
      }
    }
  ]
}

Create a document_type
POST/api/v2/document_types


PATCH /api/v2/document_types/1
Requestsupdates document_typereturns error

PATCH  /api/v2/document_types/16

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "16",
    "type": "document_types",
    "attributes": {
      "name": "new name",
      "tax1_name": "VAT",
      "tax1_value": 25,
      "locale": "en_US",
      "number": null,
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "number_format": null,
      "footer": null,
      "template_options": {}
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "38"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 663
        }
      }
    }
  },
  "included": [
    {
      "id": "38",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary7",
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 663
          }
        }
      }
    }
  ]
}

PATCH  /api/v2/document_types/17

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a document_type
PATCH/api/v2/document_types/{id}

URI Parameters
HideShow
id
number (required) Example: 1

document type id


Emails

Emails

Supported filter params

  • status

  • creator_id

GET /api/v2/emails
Requestsreturns emails

GET  /api/v2/emails

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "13",
      "type": "emails",
      "attributes": {
        "subject": null,
        "body": "Email text body",
        "auto_linked": false,
        "dismissed_at": null,
        "created_at": "2018-02-15T22:34:28.248+01:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1454"
          }
        },
        "deal": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "recipients": {
          "data": []
        },
        "cc_recipients": {
          "data": []
        },
        "attachments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "1454",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user308@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:28.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2037"
          }
        }
      }
    },
    {
      "id": "2037",
      "type": "companies",
      "attributes": {
        "name": "Client256",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:28.235+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get emails
GET/api/v2/emails


GET /api/v2/emails/1
Requestsreturns email

GET  /api/v2/emails/15

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": null,
      "created_at": "2018-02-15T22:34:28.726+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1458"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1458",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user312@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:28.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2041"
          }
        }
      }
    },
    {
      "id": "2041",
      "type": "companies",
      "attributes": {
        "name": "Client258",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:28.714+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a email
GET/api/v2/emails/{id}

URI Parameters
HideShow
id
number (required) Example: 1

email id


PATCH /api/v2/emails/1/attach
Requestsattaches emailreturns error

PATCH  /api/v2/emails/16/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "emails",
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "204"
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "16",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": null,
      "created_at": "2018-02-15T22:34:28.945+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1460"
        }
      },
      "deal": {
        "data": {
          "type": "deals",
          "id": "204"
        }
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1460",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user314@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:28.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2043"
          }
        }
      }
    },
    {
      "id": "204",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:28.996+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1459"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2044"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1461"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1459"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "2043",
      "type": "companies",
      "attributes": {
        "name": "Client259",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:28.933+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1459",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user313@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:29.000+01:00",
        "last_seen_at": "2018-02-15T22:34:29.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2042"
          }
        }
      }
    },
    {
      "id": "2044",
      "type": "companies",
      "attributes": {
        "name": "Client260",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:28.950+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1461",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user315@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:28.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2045"
          }
        }
      }
    },
    {
      "id": "1459",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 669
          }
        }
      }
    },
    {
      "id": "2042",
      "type": "companies",
      "attributes": {
        "name": "Organization185",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:28.822+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2045",
      "type": "companies",
      "attributes": {
        "name": "Client261",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:28.963+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/emails/17/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "emails",
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": ""
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/deal"
      }
    }
  ]
}

Attachs a email
PATCH/api/v2/emails/{id}/attach

URI Parameters
HideShow
id
number (required) Example: 1

email id


PATCH /api/v2/emails/1/dismiss
Requestsdismisses email

PATCH  /api/v2/emails/20/dismiss

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "20",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": "2018-02-15T22:34:29.982+01:00",
      "created_at": "2018-02-15T22:34:29.969+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1470"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1470",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user324@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:29.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2055"
          }
        }
      }
    },
    {
      "id": "2055",
      "type": "companies",
      "attributes": {
        "name": "Client267",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:29.956+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Dismisses a email
PATCH/api/v2/emails/{id}/dismiss

URI Parameters
HideShow
id
number (required) Example: 1

email id


DELETE /api/v2/emails/1
Requestsdeletes email

DELETE  /api/v2/emails/23

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a email
DELETE/api/v2/emails/{id}

URI Parameters
HideShow
id
number (required) Example: 1

email id


Expenses

Expenses

Supported filter params

  • deal_id
GET /api/v2/expenses
Requestsreturns expenses

GET  /api/v2/expenses

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "16",
      "type": "expenses",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "pay_on": null,
        "paid_on": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 10000,
        "amount_default": 12500,
        "amount_normalized": 10000,
        "reimbursable_amount": 0,
        "reimbursable_amount_default": 0,
        "reimbursable_amount_normalized": 0,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000
      },
      "relationships": {
        "deal": {
          "data": {
            "type": "deals",
            "id": "206"
          }
        },
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "95"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "206",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:30.899+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 10000,
        "expense_default": 12500,
        "expense_normalized": 10000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1479"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2065"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1480"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "95",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 678
          }
        }
      }
    },
    {
      "id": "1479",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user333@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:30.000+01:00",
        "last_seen_at": "2018-02-15T22:34:30.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2064"
          }
        }
      }
    },
    {
      "id": "2065",
      "type": "companies",
      "attributes": {
        "name": "Client272",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:30.860+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1480",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user334@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:30.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2066"
          }
        }
      }
    },
    {
      "id": "2064",
      "type": "companies",
      "attributes": {
        "name": "Organization194",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:30.766+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2066",
      "type": "companies",
      "attributes": {
        "name": "Client273",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:30.873+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get expenses
GET/api/v2/expenses


GET /api/v2/expenses/1
Requestsreturns expense

GET  /api/v2/expenses/17

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "date": "2018-02-15",
      "pay_on": null,
      "paid_on": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 12500,
      "amount_normalized": 10000,
      "reimbursable_amount": 0,
      "reimbursable_amount_default": 0,
      "reimbursable_amount_normalized": 0,
      "profit": -10000,
      "profit_default": -12500,
      "profit_normalized": -10000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "207"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "96"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "207",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:31.244+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 10000,
        "expense_default": 12500,
        "expense_normalized": 10000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1481"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2068"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1482"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "96",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 679
          }
        }
      }
    },
    {
      "id": "1481",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user335@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:31.000+01:00",
        "last_seen_at": "2018-02-15T22:34:31.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2067"
          }
        }
      }
    },
    {
      "id": "2068",
      "type": "companies",
      "attributes": {
        "name": "Client274",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:31.207+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1482",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user336@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:31.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2069"
          }
        }
      }
    },
    {
      "id": "2067",
      "type": "companies",
      "attributes": {
        "name": "Organization195",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:31.104+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2069",
      "type": "companies",
      "attributes": {
        "name": "Client275",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:31.219+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a expense
GET/api/v2/expenses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

expense id


POST /api/v2/expenses
Requestscreates expensereturns error

POST  /api/v2/expenses

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "amount": "10000",
      "currency": "USD",
      "date": "Feb 15, 2018"
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "208"
        }
      },
      "service_type": {
        "data": {
          "type": "service-type",
          "id": "97"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "19",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "date": "2018-02-15",
      "pay_on": null,
      "paid_on": null,
      "currency": "USD",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 10000,
      "amount_normalized": 8000,
      "reimbursable_amount": 0,
      "reimbursable_amount_default": 0,
      "reimbursable_amount_normalized": 0,
      "profit": -8000,
      "profit_default": -10000,
      "profit_normalized": -8000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "208"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "97"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "208",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:31.605+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 18000,
        "cost_default": 22500,
        "cost_normalized": 18000,
        "profit": -18000,
        "profit_default": -22500,
        "profit_normalized": -18000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 18000,
        "expense_default": 22500,
        "expense_normalized": 18000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1483"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2071"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1484"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "97",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 680
          }
        }
      }
    },
    {
      "id": "1483",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user337@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:31.000+01:00",
        "last_seen_at": "2018-02-15T22:34:31.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2070"
          }
        }
      }
    },
    {
      "id": "2071",
      "type": "companies",
      "attributes": {
        "name": "Client276",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:31.529+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1484",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user338@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:31.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2072"
          }
        }
      }
    },
    {
      "id": "2070",
      "type": "companies",
      "attributes": {
        "name": "Organization196",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:31.430+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2072",
      "type": "companies",
      "attributes": {
        "name": "Client277",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:31.542+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/expenses

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "expenses",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/deal"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/service_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/amount"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not an valid currency",
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/date"
      }
    }
  ]
}

Create a expense
POST/api/v2/expenses


PATCH /api/v2/expenses/1
Requestsupdates expensereturns error

PATCH  /api/v2/expenses/23

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "expenses",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "23",
    "type": "expenses",
    "attributes": {
      "name": "new name",
      "date": "2018-02-15",
      "pay_on": null,
      "paid_on": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 12500,
      "amount_normalized": 10000,
      "reimbursable_amount": 0,
      "reimbursable_amount_default": 0,
      "reimbursable_amount_normalized": 0,
      "profit": -10000,
      "profit_default": -12500,
      "profit_normalized": -10000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "212"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "101"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "212",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-02-15",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2018-02-15T22:34:32.749+01:00",
        "note": null,
        "note_interpolated": null,
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 10000,
        "expense_default": 12500,
        "expense_normalized": 10000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1491"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2083"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1492"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "101",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 684
          }
        }
      }
    },
    {
      "id": "1491",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user345@email.com",
        "title": null,
        "joined_at": "2018-02-15T22:34:32.000+01:00",
        "last_seen_at": "2018-02-15T22:34:32.000+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2082"
          }
        }
      }
    },
    {
      "id": "2083",
      "type": "companies",
      "attributes": {
        "name": "Client284",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:32.706+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1492",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user346@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-02-15T22:34:32.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2084"
          }
        }
      }
    },
    {
      "id": "2082",
      "type": "companies",
      "attributes": {
        "name": "Organization200",
        "default_currency": "USD",
        "created_at": "2018-02-15T22:34:32.610+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2084",
      "type": "companies",
      "attributes": {
        "name": "Client285",
        "default_currency": null,
        "created_at": "2018-02-15T22:34:32.718+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/expenses/24

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "expenses",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a expense
PATCH/api/v2/expenses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

expense id


DELETE /api/v2/expenses/1
Requestsdeletes expense

DELETE  /api/v2/expenses/26

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a expense
DELETE/api/v2/expenses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

expense id


Filters

Filters

GET /api/v2/filters
Requestsreturns filters

GET  /api/v2/filters

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "13-projects",
      "type": "filters",
      "attributes": {
        "name": "filter test name",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": 13,
        "default": false,
        "public": false,
        "params": {
          "name": "person",
          "assignee": "2"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 688
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/filters?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/filters?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get filters
GET/api/v2/filters


GET /api/v2/filters/1
Requestsreturns filter

GET  /api/v2/filters/14

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14-projects",
    "type": "filters",
    "attributes": {
      "name": "filter test name",
      "filterable_id": null,
      "filterable_type": null,
      "filterable_collection": "projects",
      "original_id": 14,
      "default": false,
      "public": false,
      "params": {
        "name": "person",
        "assignee": "2"
      }
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 689
        }
      }
    }
  }
}

Gets a filter
GET/api/v2/filters/{id}

URI Parameters
HideShow
id
number (required) Example: 1

filter id


POST /api/v2/filters
Requestscreates filterreturns error

POST  /api/v2/filters

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "filters",
    "attributes": {
      "name": "test name",
      "filterable_collection": "projects"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "16-projects",
    "type": "filters",
    "attributes": {
      "name": "test name",
      "filterable_id": null,
      "filterable_type": null,
      "filterable_collection": "projects",
      "original_id": 16,
      "default": false,
      "public": false,
      "params": {}
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 690
        }
      }
    }
  }
}

POST  /api/v2/filters

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "filters",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/filterable_collection"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/filterable_type"
      }
    }
  ]
}

Create a filter
POST/api/v2/filters


PATCH /api/v2/filters/1
Requestsupdates filterreturns error

PATCH  /api/v2/filters/21

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "filters",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "21-projects",
    "type": "filters",
    "attributes": {
      "name": "new name",
      "filterable_id": null,
      "filterable_type": null,
      "filterable_collection": "projects",
      "original_id": 21,
      "default": false,
      "public": false,
      "params": {}
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 694
        }
      }
    }
  }
}

PATCH  /api/v2/filters/22

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "filters",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a filter
PATCH/api/v2/filters/{id}

URI Parameters
HideShow
id
number (required) Example: 1

filter id


DELETE /api/v2/filters/1
Requestsdeletes filter

DELETE  /api/v2/filters/24

Headers
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a filter
DELETE/api/v2/filters/{id}

URI Parameters
HideShow
id
number (required) Example: 1

filter id


Holidays

Holidays

GET /api/v2/holidays
Requestsreturns holidays

GET  /api/v2/holidays

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "23",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2018-02-15"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 698
          }
        }
      }
    },
    {
      "id": "24",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2018-02-15"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id":