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

  • invoice_id

  • company_id

  • person_id

  • creator_id

  • pinned

  • has_attachments

  • parent_type

  • root_type

  • after

  • before

GET /api/v2/activities
Requestsreturns activities

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

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": 1695,
        "item_type": "task",
        "item_name": "#1: Ticket title",
        "item_deleted_at": null,
        "parent_id": 6948,
        "parent_type": "project",
        "parent_name": "test project",
        "parent_deleted_at": null,
        "root_id": 6948,
        "root_type": "project",
        "root_name": "test project",
        "root_deleted_at": null,
        "deal_is_budget": false,
        "task_id": 1695,
        "deal_id": null,
        "invoice_id": null,
        "company_id": null,
        "person_id": null,
        "created_at": "2018-06-08T17:06:07.031+02:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "14727"
          }
        },
        "comment": {
          "data": null
        },
        "email": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "14727",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user91@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:07.000+02:00",
        "last_seen_at": "2018-06-08T17:06:07.074+02: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": "21851"
          }
        }
      }
    },
    {
      "id": "21851",
      "type": "companies",
      "attributes": {
        "name": "Organization63",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:06.260+02: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=1695&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": 1700,
      "item_type": "task",
      "item_name": "#1: Ticket title",
      "item_deleted_at": null,
      "parent_id": 6963,
      "parent_type": "project",
      "parent_name": "test project",
      "parent_deleted_at": null,
      "root_id": 6963,
      "root_type": "project",
      "root_name": "test project",
      "root_deleted_at": null,
      "deal_is_budget": false,
      "task_id": 1700,
      "deal_id": null,
      "invoice_id": null,
      "company_id": null,
      "person_id": null,
      "created_at": "2018-06-08T17:06:12.937+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14757"
        }
      },
      "comment": {
        "data": null
      },
      "email": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "14757",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user121@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:12.000+02:00",
        "last_seen_at": "2018-06-08T17:06:12.950+02: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": "21896"
          }
        }
      }
    },
    {
      "id": "21896",
      "type": "companies",
      "attributes": {
        "name": "Organization66",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:12.300+02: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

Supported filter params

  • comment_id

  • page_id

  • task_id

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",
      "content_type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/009/original/img.png?1528470373",
      "thumb": "/system/attachments/files/000/000/009/thumb/img.png?1528470373",
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/4cc3a6bec8e3e1bbc9fbaf03d0e448f6/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wNi0wOVQwMTowNjoxM1oiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "sXbpV1unIKe9nOkrDezifiTQtBg=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14763"
        }
      }
    }
  },
  "included": [
    {
      "id": "14763",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user127@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:13.000+02:00",
        "last_seen_at": "2018-06-08T17:06:13.386+02: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": "21905"
          }
        }
      }
    },
    {
      "id": "21905",
      "type": "companies",
      "attributes": {
        "name": "Organization67",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:13.059+02: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": "34",
      "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,
      "content_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/939fe8ff5bcb3f8ff647db7a76d3a740/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wNi0wOVQwMTowNjoxM1oiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "sXbpV1unIKe9nOkrDezifiTQtBg=",
        "Content-Type": null
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14764"
        }
      }
    }
  },
  "included": [
    {
      "id": "14764",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user128@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:13.000+02:00",
        "last_seen_at": "2018-06-08T17:06:13.793+02: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": "21907"
          }
        }
      }
    },
    {
      "id": "21907",
      "type": "companies",
      "attributes": {
        "name": "Organization68",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:13.561+02: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

URI Parameters
HideShow
name
string (required) Example: name

name

id
string (required) Example: Comment

attachable_type


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",
      "content_type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/013/original/img.png?1528470374",
      "thumb": "/system/attachments/files/000/000/013/thumb/img.png?1528470374",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/e496ce8f61dfcd698b28ca54c44d22a1/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wNi0wOVQwMTowNjoxNVoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "Esc6AAlkGAdzI7brwOw7n826Lrk=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14766"
        }
      }
    }
  },
  "included": [
    {
      "id": "14766",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user130@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:14.000+02:00",
        "last_seen_at": "2018-06-08T17:06:14.964+02: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": "21911"
          }
        }
      }
    },
    {
      "id": "21911",
      "type": "companies",
      "attributes": {
        "name": "Organization70",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:14.487+02: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

  • group

  • person_id

  • service_type_id

  • tags

  • after

  • before

GET /api/v2/billability_reports
Requestsreturns billability reports

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "billability-report-person-14770",
      "type": "billability_reports",
      "attributes": {
        "group": "person",
        "internal_time": 0,
        "client_time": 480
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "14770"
          }
        },
        "service_type": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "14770",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user134@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:16.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21918"
          }
        }
      }
    },
    {
      "id": "21918",
      "type": "companies",
      "attributes": {
        "name": "Client98",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:16.237+02: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=14770&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/billability_reports?filter%5Bperson_id%5D=14770&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

  • id

  • project_id

GET /api/v2/boards
Requestsreturns boards

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "2497",
      "type": "boards",
      "attributes": {
        "name": "board name",
        "position": 1,
        "archived_at": null
      },
      "relationships": {
        "project": {
          "data": {
            "type": "projects",
            "id": "6966"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "6966",
      "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": "21923"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "14773"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "21923",
      "type": "companies",
      "attributes": {
        "name": "Client102",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:16.951+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14773",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user137@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:16.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21922"
          }
        }
      }
    },
    {
      "id": "21922",
      "type": "companies",
      "attributes": {
        "name": "Client101",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:16.935+02: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=6966&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/boards?filter%5Bproject_id%5D=6966&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/2498

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2498",
    "type": "boards",
    "attributes": {
      "name": "board name",
      "position": 1,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "6967"
        }
      }
    }
  },
  "included": [
    {
      "id": "6967",
      "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": "21926"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "14775"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "21926",
      "type": "companies",
      "attributes": {
        "name": "Client104",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:17.382+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14775",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user139@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:17.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21925"
          }
        }
      }
    },
    {
      "id": "21925",
      "type": "companies",
      "attributes": {
        "name": "Client103",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:17.359+02: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": "6968"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2500",
    "type": "boards",
    "attributes": {
      "name": "test name",
      "position": 2,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "6968"
        }
      }
    }
  },
  "included": [
    {
      "id": "6968",
      "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": "21929"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "14777"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "21929",
      "type": "companies",
      "attributes": {
        "name": "Client106",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:17.792+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14777",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user141@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:17.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21928"
          }
        }
      }
    },
    {
      "id": "21928",
      "type": "companies",
      "attributes": {
        "name": "Client105",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:17.775+02: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

URI Parameters
HideShow
name
string (required) Example: Name

name


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

PATCH  /api/v2/boards/2503

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": "2503",
    "type": "boards",
    "attributes": {
      "name": "new name",
      "position": 1,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "6971"
        }
      }
    }
  },
  "included": [
    {
      "id": "6971",
      "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": "21938"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "14783"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "21938",
      "type": "companies",
      "attributes": {
        "name": "Client112",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:19.273+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14783",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user147@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:19.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21937"
          }
        }
      }
    },
    {
      "id": "21937",
      "type": "companies",
      "attributes": {
        "name": "Client111",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:19.258+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/boards/2504

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/2506/archive

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2506",
    "type": "boards",
    "attributes": {
      "name": "board name",
      "position": null,
      "archived_at": "2018-06-08T15:06:20.587Z"
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "6974"
        }
      }
    }
  },
  "included": [
    {
      "id": "6974",
      "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": "21947"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "14789"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "21947",
      "type": "companies",
      "attributes": {
        "name": "Client118",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:20.411+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14789",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user153@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:20.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21946"
          }
        }
      }
    },
    {
      "id": "21946",
      "type": "companies",
      "attributes": {
        "name": "Client117",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:20.395+02: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/2507/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2507",
    "type": "boards",
    "attributes": {
      "name": "Board11",
      "position": 2,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "6975"
        }
      }
    }
  },
  "included": [
    {
      "id": "6975",
      "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": "21950"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "14791"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "21950",
      "type": "companies",
      "attributes": {
        "name": "Client120",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:20.903+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14791",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user155@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:20.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21949"
          }
        }
      }
    },
    {
      "id": "21949",
      "type": "companies",
      "attributes": {
        "name": "Client119",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:20.887+02: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

  • event_id

  • project_id

  • tags

  • after

  • before

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,
        "time": 360,
        "started_on": "2018-06-08",
        "ended_on": "2018-06-08",
        "note": null,
        "total_hours": 0,
        "total_time": 0,
        "created_at": "2018-06-08T17:06:21.569+02:00",
        "updated_at": "2018-06-08T17:06:21.569+02:00"
      },
      "relationships": {
        "service": {
          "data": null
        },
        "event": {
          "data": {
            "type": "events",
            "id": "8"
          }
        },
        "person": {
          "data": {
            "type": "people",
            "id": "14793"
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "14792"
          }
        },
        "updater": {
          "data": {
            "type": "people",
            "id": "14792"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "8",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 773
          }
        }
      }
    },
    {
      "id": "14793",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user157@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:21.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21952"
          }
        }
      }
    },
    {
      "id": "14792",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user156@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:21.000+02:00",
        "last_seen_at": "2018-06-08T17:06:21.596+02: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": "21951"
          }
        }
      }
    },
    {
      "id": "21952",
      "type": "companies",
      "attributes": {
        "name": "Client121",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:21.518+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21951",
      "type": "companies",
      "attributes": {
        "name": "Organization84",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:21.310+02: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,
      "time": 360,
      "started_on": "2018-06-08",
      "ended_on": "2018-06-08",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2018-06-08T17:06:21.912+02:00",
      "updated_at": "2018-06-08T17:06:21.912+02:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "9"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "14795"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "14794"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "14794"
        }
      }
    }
  },
  "included": [
    {
      "id": "9",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 774
          }
        }
      }
    },
    {
      "id": "14795",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user159@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:21.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21954"
          }
        }
      }
    },
    {
      "id": "14794",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user158@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:21.000+02:00",
        "last_seen_at": "2018-06-08T17:06:21.927+02: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": "21953"
          }
        }
      }
    },
    {
      "id": "21954",
      "type": "companies",
      "attributes": {
        "name": "Client122",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:21.890+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21953",
      "type": "companies",
      "attributes": {
        "name": "Organization85",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:21.748+02: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": "Jun  8, 2018",
      "ended_on": "Jun  8, 2018",
      "time": "360"
    },
    "relationships": {
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "14797"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "bookings",
    "attributes": {
      "hours": 6,
      "time": 360,
      "started_on": "2018-06-08",
      "ended_on": "2018-06-08",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2018-06-08T17:06:22.405+02:00",
      "updated_at": "2018-06-08T17:06:22.405+02:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "14797"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "14796"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "14796"
        }
      }
    }
  },
  "included": [
    {
      "id": "10",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 775
          }
        }
      }
    },
    {
      "id": "14797",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user161@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:22.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21956"
          }
        }
      }
    },
    {
      "id": "14796",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user160@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:22.000+02:00",
        "last_seen_at": "2018-06-08T17:06:22.337+02: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": "21955"
          }
        }
      }
    },
    {
      "id": "21956",
      "type": "companies",
      "attributes": {
        "name": "Client123",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:22.249+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21955",
      "type": "companies",
      "attributes": {
        "name": "Organization86",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:22.120+02: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": {
      "time": ""
    }
  }
}
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/time"
      }
    }
  ]
}

Create a booking
POST/api/v2/bookings

URI Parameters
HideShow
person_id
number (required) Example: 1

person id

started_on
date (required) Example: 2018-01-01

started on

ended_on
date (required) Example: 2018-01-31

ended on

time
number (required) Example: 60

time


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": {
      "time": "120"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "bookings",
    "attributes": {
      "hours": 2,
      "time": 120,
      "started_on": "2018-06-08",
      "ended_on": "2018-06-08",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2018-06-08T17:06:23.191+02:00",
      "updated_at": "2018-06-08T17:06:23.350+02:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "12"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "14801"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "14800"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "14800"
        }
      }
    }
  },
  "included": [
    {
      "id": "12",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 777
          }
        }
      }
    },
    {
      "id": "14801",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user165@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:23.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "21960"
          }
        }
      }
    },
    {
      "id": "14800",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user164@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:23.000+02:00",
        "last_seen_at": "2018-06-08T17:06:23.210+02: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": "21959"
          }
        }
      }
    },
    {
      "id": "21960",
      "type": "companies",
      "attributes": {
        "name": "Client125",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:23.143+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21959",
      "type": "companies",
      "attributes": {
        "name": "Organization88",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:22.839+02: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": {
      "time": ""
    }
  }
}
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/time"
      }
    }
  ]
}

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/39

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "39",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2018-06-08T17:06:24.613+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14806"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "21966"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14806",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user170@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:24.000+02:00",
        "last_seen_at": "2018-06-08T17:06:24.633+02: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": "21965"
          }
        }
      }
    },
    {
      "id": "21966",
      "type": "companies",
      "attributes": {
        "name": "Client128",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:24.601+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21965",
      "type": "companies",
      "attributes": {
        "name": "Organization91",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:24.440+02: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": "41",
    "type": "comments",
    "attributes": {
      "commentable_type": "task",
      "body": null,
      "created_at": "2018-06-08T17:06:25.015+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14807"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": null
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14807",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user171@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:24.000+02:00",
        "last_seen_at": "2018-06-08T17:06:24.969+02: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": "21967"
          }
        }
      }
    },
    {
      "id": "21967",
      "type": "companies",
      "attributes": {
        "name": "Organization92",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:24.772+02: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/43

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": "43",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "new body",
      "created_at": "2018-06-08T17:06:25.465+02:00",
      "pinned_at": null,
      "edited_at": "2018-06-08T17:06:25.533+02:00",
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14809"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "21972"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14809",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user173@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:25.000+02:00",
        "last_seen_at": "2018-06-08T17:06:25.482+02: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": "21971"
          }
        }
      }
    },
    {
      "id": "21972",
      "type": "companies",
      "attributes": {
        "name": "Client131",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:25.457+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21971",
      "type": "companies",
      "attributes": {
        "name": "Organization94",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:25.322+02: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/45/pin

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "45",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2018-06-08T17:06:26.069+02:00",
      "pinned_at": "2018-06-08T17:06:26.091+02:00",
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14811"
        }
      },
      "pinned_by": {
        "data": {
          "type": "people",
          "id": "14811"
        }
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "21976"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14811",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user175@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:26.000+02:00",
        "last_seen_at": "2018-06-08T17:06:26.084+02: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": "21975"
          }
        }
      }
    },
    {
      "id": "21976",
      "type": "companies",
      "attributes": {
        "name": "Client133",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:26.064+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21975",
      "type": "companies",
      "attributes": {
        "name": "Organization96",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:25.961+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/comments/46/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/47/unpin

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "47",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2018-06-08T17:06:26.600+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14813"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "21980"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14813",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user177@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:26.000+02:00",
        "last_seen_at": "2018-06-08T17:06:26.622+02: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": "21979"
          }
        }
      }
    },
    {
      "id": "21980",
      "type": "companies",
      "attributes": {
        "name": "Client135",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:26.593+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21979",
      "type": "companies",
      "attributes": {
        "name": "Organization98",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:26.415+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/comments/48/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/49

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

  • id

  • status (1: active, 2: archived)

  • 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": "21986",
      "type": "companies",
      "attributes": {
        "name": "Client138",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:27.206+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "21985",
      "type": "companies",
      "attributes": {
        "name": "Organization101",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:27.103+02: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/21988

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "21988",
    "type": "companies",
    "attributes": {
      "name": "Client139",
      "default_currency": null,
      "created_at": "2018-06-08T17:06:27.397+02: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": "21991",
    "type": "companies",
    "attributes": {
      "name": "test name",
      "default_currency": null,
      "created_at": "2018-06-08T17:06:27.650+02: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

URI Parameters
HideShow
name
string (required) Example: Name

name


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

PATCH  /api/v2/companies/21995

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": "14821"
          },
          {
            "type": "people",
            "id": "14822"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "21995",
    "type": "companies",
    "attributes": {
      "name": "new name",
      "default_currency": null,
      "created_at": "2018-06-08T17:06:28.003+02: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/21999

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/22001/archive

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "22001",
    "type": "companies",
    "attributes": {
      "name": "Client146",
      "default_currency": null,
      "created_at": "2018-06-08T17:06:28.663+02:00",
      "archived_at": "2018-06-08T17:06:28.000+02:00",
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/companies/22003/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/22005/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/22007/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "22007",
    "type": "companies",
    "attributes": {
      "name": "Client149",
      "default_currency": null,
      "created_at": "2018-06-08T17:06:29.146+02: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

  • invoice_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": "57",
      "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": "22009"
          }
        },
        "person": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "subsidiary": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 800
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "22009",
      "type": "companies",
      "attributes": {
        "name": "Client150",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:29.379+02: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/58

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "58",
    "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": "22011"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 801
        }
      }
    }
  },
  "included": [
    {
      "id": "22011",
      "type": "companies",
      "attributes": {
        "name": "Client151",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:29.962+02: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": "22013"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "60",
    "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": "22013"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 802
        }
      }
    }
  },
  "included": [
    {
      "id": "22013",
      "type": "companies",
      "attributes": {
        "name": "Client152",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:30.229+02: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

URI Parameters
HideShow
name
string (required) Example: Name

name

type
string (required) Example: Address

type

contactable_type
string (required) Example: Client

contactable type


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

PATCH  /api/v2/contact_entries/69

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": "69",
    "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": "22026"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 808
        }
      }
    }
  },
  "included": [
    {
      "id": "22026",
      "type": "companies",
      "attributes": {
        "name": "Client159",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:32.556+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/contact_entries/70

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/72

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": "142"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "142",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "014303954aec9f1e04e8260246f6d6b2",
        "purchase_order_number": 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-06-08T17:06:33.669+02: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": "14843"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22037"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14844"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "4128"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "14843",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user207@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": "22036"
          }
        }
      }
    },
    {
      "id": "22037",
      "type": "companies",
      "attributes": {
        "name": "Client165",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:33.616+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14844",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user208@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:33.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22038"
          }
        }
      }
    },
    {
      "id": "4128",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 813
          }
        }
      }
    },
    {
      "id": "22036",
      "type": "companies",
      "attributes": {
        "name": "Organization124",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:33.491+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22038",
      "type": "companies",
      "attributes": {
        "name": "Client166",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:33.634+02: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": "143"
        }
      }
    }
  },
  "included": [
    {
      "id": "143",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "7cfc62af2f5e565fb2f25100095d91ce",
        "purchase_order_number": 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-06-08T17:06:34.051+02: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": "14845"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22040"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14846"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "4134"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "14845",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user209@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": "22039"
          }
        }
      }
    },
    {
      "id": "22040",
      "type": "companies",
      "attributes": {
        "name": "Client167",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:34.003+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14846",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user210@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:34.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22041"
          }
        }
      }
    },
    {
      "id": "4134",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 814
          }
        }
      }
    },
    {
      "id": "22039",
      "type": "companies",
      "attributes": {
        "name": "Organization125",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:33.893+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22041",
      "type": "companies",
      "attributes": {
        "name": "Client168",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:34.018+02: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": "145"
        }
      }
    }
  }
}
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": "154"
        }
      }
    }
  },
  "included": [
    {
      "id": "145",
      "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,
        "email_key": "6dc689f7e6eb0e47e4758dfaf9a7970a",
        "purchase_order_number": 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": "14847"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22045"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14849"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": {
            "type": "contracts",
            "id": "16"
          }
        }
      }
    },
    {
      "id": "14847",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user211@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": "22042"
          }
        }
      }
    },
    {
      "id": "22045",
      "type": "companies",
      "attributes": {
        "name": "Client171",
        "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": "14849",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user213@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": "22046"
          }
        }
      }
    },
    {
      "id": "22042",
      "type": "companies",
      "attributes": {
        "name": "Organization126",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:34.279+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22046",
      "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
        }
      }
    }
  ]
}

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": "159"
        }
      }
    }
  },
  "included": [
    {
      "id": "150",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "17f6e8c719525eccfc12e97647baddce",
        "purchase_order_number": 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-06-08T17:06:36.119+02: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": "14857"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22059"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14858"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "4165"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "14857",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user221@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": "22058"
          }
        }
      }
    },
    {
      "id": "22059",
      "type": "companies",
      "attributes": {
        "name": "Client181",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:36.075+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14858",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user222@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:36.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22060"
          }
        }
      }
    },
    {
      "id": "4165",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 819
          }
        }
      }
    },
    {
      "id": "22058",
      "type": "companies",
      "attributes": {
        "name": "Organization130",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:35.896+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22060",
      "type": "companies",
      "attributes": {
        "name": "Client182",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:36.089+02: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": "14868"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "14868",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user232@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:37.000+02:00",
        "last_seen_at": "2018-06-08T17:06:37.783+02: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": "22076"
          }
        }
      }
    },
    {
      "id": "22076",
      "type": "companies",
      "attributes": {
        "name": "Organization134",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:37.280+02: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": "14869"
        }
      }
    }
  },
  "included": [
    {
      "id": "14869",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user233@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:38.000+02:00",
        "last_seen_at": "2018-06-08T17:06:38.480+02: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": "22078"
          }
        }
      }
    },
    {
      "id": "22078",
      "type": "companies",
      "attributes": {
        "name": "Organization136",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:37.965+02: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

URI Parameters
HideShow
name
string (required) Example: Name

name


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": "14871"
        }
      }
    }
  },
  "included": [
    {
      "id": "14871",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user235@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:39.000+02:00",
        "last_seen_at": "2018-06-08T17:06:39.273+02: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": "22082"
          }
        }
      }
    },
    {
      "id": "22082",
      "type": "companies",
      "attributes": {
        "name": "Organization140",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:39.000+02: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

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": "4244",
      "type": "deal_statuses",
      "attributes": {
        "name": "Lead",
        "position": 1
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 835
          }
        }
      }
    },
    {
      "id": "4245",
      "type": "deal_statuses",
      "attributes": {
        "name": "Prospect",
        "position": 2
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 835
          }
        }
      }
    },
    {
      "id": "4246",
      "type": "deal_statuses",
      "attributes": {
        "name": "Proposal sent",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 835
          }
        }
      }
    },
    {
      "id": "4247",
      "type": "deal_statuses",
      "attributes": {
        "name": "Negotiation",
        "position": 4
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 835
          }
        }
      }
    },
    {
      "id": "4248",
      "type": "deal_statuses",
      "attributes": {
        "name": "Awaiting approval",
        "position": 5
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 835
          }
        }
      }
    },
    {
      "id": "4249",
      "type": "deal_statuses",
      "attributes": {
        "name": "test deal status",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 835
          }
        }
      }
    }
  ],
  "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": 6,
    "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/4255

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

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": "4262",
    "type": "deal_statuses",
    "attributes": {
      "name": "test name",
      "position": 7
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 837
        }
      }
    }
  }
}

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

URI Parameters
HideShow
name
string (required) Example: Name

name


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

PATCH  /api/v2/deal_statuses/4274

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": "4274",
    "type": "deal_statuses",
    "attributes": {
      "name": "new name",
      "position": 6
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 839
        }
      }
    }
  }
}

PATCH  /api/v2/deal_statuses/4280

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/4286

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

DELETE  /api/v2/deal_statuses/4292

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

  • id

  • responsible_id

  • company_id

  • status_id

  • sales_status_id (1: open, 2: won, 3: lost)

  • stage_id

  • contract_id

  • recurring

  • project_id

  • tags

  • query

  • after

  • before

  • won_after

  • won_before

  • lost_after

  • lost_before

  • closed_after

  • closed_before

  • needs_invoicing

  • type (1: deal, 2: budget)

  • budget_status (1: open, 2: closed)

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": "159",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "b6f31e27a1cf7bc931fcb64b69ff566b",
        "purchase_order_number": 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-06-08T17:06:42.145+02: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": "14886"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22103"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14887"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "4312"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "14886",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user250@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:42.000+02:00",
        "last_seen_at": "2018-06-08T17:06:42.182+02: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": "22102"
          }
        }
      }
    },
    {
      "id": "22103",
      "type": "companies",
      "attributes": {
        "name": "Client199",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:42.088+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14887",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user251@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:42.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22104"
          }
        }
      }
    },
    {
      "id": "4312",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 845
          }
        }
      }
    },
    {
      "id": "22102",
      "type": "companies",
      "attributes": {
        "name": "Organization156",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:41.978+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22104",
      "type": "companies",
      "attributes": {
        "name": "Client200",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:42.104+02: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/160

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "160",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-06-08",
      "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,
      "email_key": "c4e1fbdc86667645db17760b34c69e8b",
      "purchase_order_number": 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-06-08T17:06:42.594+02: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": "14888"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "22106"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "14889"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "4318"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "14888",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user252@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:42.000+02:00",
        "last_seen_at": "2018-06-08T17:06:42.626+02: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": "22105"
          }
        }
      }
    },
    {
      "id": "22106",
      "type": "companies",
      "attributes": {
        "name": "Client201",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:42.525+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14889",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user253@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:42.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22107"
          }
        }
      }
    },
    {
      "id": "4318",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 846
          }
        }
      }
    },
    {
      "id": "22105",
      "type": "companies",
      "attributes": {
        "name": "Organization157",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:42.417+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22107",
      "type": "companies",
      "attributes": {
        "name": "Client202",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:42.544+02: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": "Jun  8, 2018",
      "deal_type_id": "2",
      "deal_status_id": "4324",
      "sales_status_id": "1",
      "probability": "50",
      "currency": "EUR"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "22109"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "14892"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "162",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-06-08",
      "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-06-08T17:06:43.000+02:00",
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "email_key": "a5142d7c4409cd4555eb86cdabb14184",
      "purchase_order_number": 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-06-08T17:06:43.884+02: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": "14890"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "22109"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "14892"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "4324"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "14890",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user254@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:43.000+02:00",
        "last_seen_at": "2018-06-08T17:06:43.727+02: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": "22108"
          }
        }
      }
    },
    {
      "id": "22109",
      "type": "companies",
      "attributes": {
        "name": "Client203",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:43.015+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14892",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user256@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2018-06-08T17:06:43.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22111"
          }
        }
      }
    },
    {
      "id": "4324",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 847
          }
        }
      }
    },
    {
      "id": "22108",
      "type": "companies",
      "attributes": {
        "name": "Organization158",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:42.808+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22111",
      "type": "companies",
      "attributes": {
        "name": "Client205",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:43.170+02: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

URI Parameters
HideShow
name
string (required) Example: Name

name

date
date (required) Example: 2018-01-01

date

responsible_id: `1` (number, required) - responsible_id
string (required) 
company_id: `1` (number, required) - company_id
string (required) 
deal_type_id
number (required) Example: 1

deal type

probability
number (required) Example: 100

probability

currency
currency (required) Example: EUR

currency

deal_status
number (required) Example: 1

deal status

sales_status
number (required) Example: 1

sales status


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

PATCH  /api/v2/deals/165

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": "14899"
        }
      },
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "14900"
          },
          {
            "type": "people",
            "id": "14901"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "165",
    "type": "deals",
    "attributes": {
      "name": "new name",
      "date": "2018-06-08",
      "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,
      "email_key": "8523e49feaff26e96b31ace08f0deaaf",
      "purchase_order_number": 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-06-08T17:06:45.350+02: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": "14897"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "22119"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "14899"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "4342"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "14897",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user261@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:45.000+02:00",
        "last_seen_at": "2018-06-08T17:06:45.524+02: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": "22118"
          }
        }
      }
    },
    {
      "id": "22119",
      "type": "companies",
      "attributes": {
        "name": "Client210",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:45.293+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14899",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user263@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2018-06-08T17:06:45.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22121"
          }
        }
      }
    },
    {
      "id": "4342",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 850
          }
        }
      }
    },
    {
      "id": "22118",
      "type": "companies",
      "attributes": {
        "name": "Organization161",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:45.119+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22121",
      "type": "companies",
      "attributes": {
        "name": "Client212",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:45.396+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/deals/166

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/167

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/182/open

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "182",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-06-08",
      "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,
      "email_key": "b7074396701170a5a08072ae98f3b566",
      "purchase_order_number": 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-06-08T17:06:50.471+02: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": "14928"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "22168"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "14930"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "14928",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user292@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:50.000+02:00",
        "last_seen_at": "2018-06-08T17:06:50.496+02: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": "22165"
          }
        }
      }
    },
    {
      "id": "22168",
      "type": "companies",
      "attributes": {
        "name": "Client249",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:50.423+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14930",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user294@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:50.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22169"
          }
        }
      }
    },
    {
      "id": "22165",
      "type": "companies",
      "attributes": {
        "name": "Organization171",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:50.248+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22169",
      "type": "companies",
      "attributes": {
        "name": "Client250",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:50.440+02: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/184/close

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "184",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2018-06-08",
      "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,
      "email_key": "8f7cb626aa1b73b6f46957b1dd3d7c8a",
      "purchase_order_number": 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-06-08T17:06:50.963+02:00",
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2018-06-08T17:06:50.924+02: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": "14931"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "22173"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "14933"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "14931",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user295@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:50.000+02:00",
        "last_seen_at": "2018-06-08T17:06:50.947+02: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": "22170"
          }
        }
      }
    },
    {
      "id": "22173",
      "type": "companies",
      "attributes": {
        "name": "Client253",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:50.881+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14933",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user297@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:50.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22174"
          }
        }
      }
    },
    {
      "id": "22170",
      "type": "companies",
      "attributes": {
        "name": "Organization172",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:50.701+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22174",
      "type": "companies",
      "attributes": {
        "name": "Client254",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:50.898+02: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": "14631"
        }
      }
    }
  },
  "included": [
    {
      "id": "14631",
      "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": 690,
        "default_organization_slug": "690-organization1",
        "intercom_hash": "dda8257107277ef0d7f0e369d6d0dd65ab2cc18d4f325fb4b30619d8f86bb0e0",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false,
        "newsletter_consent": false,
        "newsletter_consent_at": null
      }
    }
  ]
}

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": "14632"
        }
      }
    }
  },
  "included": [
    {
      "id": "14632",
      "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": 691,
        "default_organization_slug": "691-organization2",
        "intercom_hash": "6b9f107926fc2a9885a4dbcafb468a9eb18b1cfd1cf2741bb1641ece0f004a03",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false,
        "newsletter_consent": false,
        "newsletter_consent_at": null
      }
    }
  ]
}

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": "14633"
        }
      }
    }
  },
  "included": [
    {
      "id": "14633",
      "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": 692,
        "default_organization_slug": "692-organization3",
        "intercom_hash": "da9667c0a3a6e4095459b9bb019d6b7c96f3775fb8661654fdbf9efc4099d36f",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false,
        "newsletter_consent": false,
        "newsletter_consent_at": null
      }
    }
  ]
}

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": "14635"
        }
      }
    }
  },
  "included": [
    {
      "id": "14635",
      "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": 693,
        "default_organization_slug": "693-organization4",
        "intercom_hash": "459b3699770ec842ac2300b2d45fe017f41d20b4d9f18672423d178c07654978",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null,
        "sysadmin": false,
        "newsletter_consent": false,
        "newsletter_consent_at": null
      }
    }
  ]
}

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

URI Parameters
HideShow
name
string (required) Example: Name

name

unique_identifier
string (required) Example: 12345

unique identifier

push_token
string (required) Example: abcd

push token

firebase_token
string (required) Example: abcd

firebase token


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

Supported filter params

  • subsidiary_id

  • exportable_type_id

  • status (1: active, 2: archived)

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": "11",
      "type": "document_types",
      "attributes": {
        "name": "normal invoice",
        "tax1_name": "VAT",
        "tax1_value": 25,
        "locale": "en_US",
        "document_template_id": 1,
        "exportable_type_id": 1,
        "note": null,
        "footer": null,
        "template_options": {},
        "deleted_at": null,
        "header_template": null,
        "body_template": null,
        "footer_template": null,
        "scss_template": null
      },
      "relationships": {
        "subsidiary": {
          "data": {
            "type": "subsidiaries",
            "id": "25"
          }
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 862
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "25",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary2",
        "invoice_number_format": null,
        "deleted_at": null,
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "integration": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 862
          }
        }
      }
    }
  ],
  "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/12

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "document_types",
    "attributes": {
      "name": "normal invoice",
      "tax1_name": "VAT",
      "tax1_value": 25,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "deleted_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "26"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 863
        }
      }
    }
  },
  "included": [
    {
      "id": "26",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary3",
        "invoice_number_format": null,
        "deleted_at": null,
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "integration": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 863
          }
        }
      }
    }
  ]
}

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": "27"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "tax1_name": null,
      "tax1_value": null,
      "locale": "hr_HR",
      "document_template_id": null,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "deleted_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "27"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 864
        }
      }
    }
  },
  "included": [
    {
      "id": "27",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary4",
        "invoice_number_format": null,
        "deleted_at": null,
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "integration": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 864
          }
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
name
string (required) Example: Name

name

locale
string (required) Example: en_US

locale

subsidiary_id
number (required) Example: 1

subsidiary id


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

PATCH  /api/v2/document_types/17

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": "17",
    "type": "document_types",
    "attributes": {
      "name": "new name",
      "tax1_name": "VAT",
      "tax1_value": 25,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "deleted_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "30"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 867
        }
      }
    }
  },
  "included": [
    {
      "id": "30",
      "type": "subsidiaries",
      "attributes": {
        "name": "Subsidiary7",
        "invoice_number_format": null,
        "deleted_at": null,
        "export_integration_type_id": null,
        "invoice_logo_url": null
      },
      "relationships": {
        "bill_from": {
          "data": null
        },
        "integration": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 867
          }
        }
      }
    }
  ]
}

PATCH  /api/v2/document_types/18

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


DELETE /api/v2/document_types/1
Requestsarchives document type

DELETE  /api/v2/document_types/20

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

ArchivesDeletes a document type
DELETE/api/v2/document_types/{id}

URI Parameters
HideShow
id
number (required) Example: 1

document type id


Emails

Emails

Supported filter params

  • status (1: unresolved, 2: resolved, 3: dismissed)

  • creator_id

  • recipient_id

  • sender_or_recipient_id

  • before

  • after

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,
        "linked_type": null,
        "linked_id": null,
        "dismissed_at": null,
        "created_at": "2018-06-08T17:06:53.821+02:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "14944"
          }
        },
        "deal": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "recipients": {
          "data": []
        },
        "cc_recipients": {
          "data": []
        },
        "attachments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "14944",
      "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-06-08T17:06:53.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22185"
          }
        }
      }
    },
    {
      "id": "22185",
      "type": "companies",
      "attributes": {
        "name": "Client255",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:53.797+02: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,
      "linked_type": null,
      "linked_id": null,
      "dismissed_at": null,
      "created_at": "2018-06-08T17:06:54.405+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14948"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14948",
      "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-06-08T17:06:54.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22189"
          }
        }
      }
    },
    {
      "id": "22189",
      "type": "companies",
      "attributes": {
        "name": "Client257",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:54.387+02: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": "185"
        }
      }
    }
  }
}
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,
      "linked_type": "Quote",
      "linked_id": 185,
      "dismissed_at": null,
      "created_at": "2018-06-08T17:06:54.684+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14950"
        }
      },
      "deal": {
        "data": {
          "type": "deals",
          "id": "185"
        }
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14950",
      "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-06-08T17:06:54.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22191"
          }
        }
      }
    },
    {
      "id": "185",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "d86b028caf14e9fa1736387bf4fcc37a",
        "purchase_order_number": 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-06-08T17:06:54.748+02: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": "14949"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22192"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14951"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "4478"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "22191",
      "type": "companies",
      "attributes": {
        "name": "Client258",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:54.670+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14949",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user313@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:54.000+02:00",
        "last_seen_at": "2018-06-08T17:06:54.777+02: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": "22190"
          }
        }
      }
    },
    {
      "id": "22192",
      "type": "companies",
      "attributes": {
        "name": "Client259",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:54.692+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14951",
      "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-06-08T17:06:54.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22193"
          }
        }
      }
    },
    {
      "id": "4478",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 6
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 874
          }
        }
      }
    },
    {
      "id": "22190",
      "type": "companies",
      "attributes": {
        "name": "Organization185",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:54.536+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22193",
      "type": "companies",
      "attributes": {
        "name": "Client260",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:54.707+02: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,
      "linked_type": null,
      "linked_id": null,
      "dismissed_at": "2018-06-08T17:06:56.007+02:00",
      "created_at": "2018-06-08T17:06:55.992+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "14960"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "14960",
      "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-06-08T17:06:55.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22203"
          }
        }
      }
    },
    {
      "id": "22203",
      "type": "companies",
      "attributes": {
        "name": "Client266",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:55.975+02: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

  • status

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": "20",
      "type": "expenses",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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": "187"
          }
        },
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "91"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "187",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "6b748b72f77b9cbf3cd2f37470602c74",
        "purchase_order_number": 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-06-08T17:06:57.546+02: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": "14971"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22215"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14972"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "91",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 884
          }
        }
      }
    },
    {
      "id": "14971",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user335@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:57.000+02:00",
        "last_seen_at": "2018-06-08T17:06:57.625+02: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": "22214"
          }
        }
      }
    },
    {
      "id": "22215",
      "type": "companies",
      "attributes": {
        "name": "Client272",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:57.490+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14972",
      "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-06-08T17:06:57.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22216"
          }
        }
      }
    },
    {
      "id": "22214",
      "type": "companies",
      "attributes": {
        "name": "Organization195",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:57.349+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22216",
      "type": "companies",
      "attributes": {
        "name": "Client273",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:57.510+02: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/21

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "21",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "date": "2018-06-08",
      "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": "188"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "92"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "188",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "949ea54e6ce8f5fa1a79f23e95d83f71",
        "purchase_order_number": 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-06-08T17:06:58.277+02: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": "14973"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22218"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14974"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "92",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 885
          }
        }
      }
    },
    {
      "id": "14973",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user337@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:58.000+02:00",
        "last_seen_at": "2018-06-08T17:06:58.353+02: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": "22217"
          }
        }
      }
    },
    {
      "id": "22218",
      "type": "companies",
      "attributes": {
        "name": "Client274",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:58.205+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14974",
      "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-06-08T17:06:58.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22219"
          }
        }
      }
    },
    {
      "id": "22217",
      "type": "companies",
      "attributes": {
        "name": "Organization196",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:57.891+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22219",
      "type": "companies",
      "attributes": {
        "name": "Client275",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:58.245+02: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": "Jun  8, 2018"
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "189"
        }
      },
      "service_type": {
        "data": {
          "type": "service-type",
          "id": "93"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "23",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "date": "2018-06-08",
      "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": "189"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "93"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "189",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "fa907a5a92cfec11fe7359960484979d",
        "purchase_order_number": 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-06-08T17:06:58.852+02: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": "14975"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22221"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14976"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "93",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 886
          }
        }
      }
    },
    {
      "id": "14975",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user339@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:06:58.000+02:00",
        "last_seen_at": "2018-06-08T17:06:58.919+02: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": "22220"
          }
        }
      }
    },
    {
      "id": "22221",
      "type": "companies",
      "attributes": {
        "name": "Client276",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:58.802+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14976",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user340@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:06:58.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22222"
          }
        }
      }
    },
    {
      "id": "22220",
      "type": "companies",
      "attributes": {
        "name": "Organization197",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:06:58.612+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22222",
      "type": "companies",
      "attributes": {
        "name": "Client277",
        "default_currency": null,
        "created_at": "2018-06-08T17:06:58.821+02: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

URI Parameters
HideShow
name
string (required) Example: Name

name

deal_id
number (required) Example: 1

deal id

service_type_id
number (required) Example: 1

service type id

amount
number (required) Example: 100

amount

currency
string (required) Example: EUR

currency

date
date (required) Example: 2018-01-01

date


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

PATCH  /api/v2/expenses/27

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": "27",
    "type": "expenses",
    "attributes": {
      "name": "new name",
      "date": "2018-06-08",
      "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": "193"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "97"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "193",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2018-06-08",
        "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,
        "email_key": "dfdeffb47918c9ae8c178fd5a4f16856",
        "purchase_order_number": 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-06-08T17:07:00.240+02: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": "14983"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "22233"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "14984"
          }
        },
        "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": 890
          }
        }
      }
    },
    {
      "id": "14983",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user347@email.com",
        "title": null,
        "joined_at": "2018-06-08T17:07:00.000+02:00",
        "last_seen_at": "2018-06-08T17:07:00.316+02: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": "22232"
          }
        }
      }
    },
    {
      "id": "22233",
      "type": "companies",
      "attributes": {
        "name": "Client284",
        "default_currency": null,
        "created_at": "2018-06-08T17:07:00.191+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "14984",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user348@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2018-06-08T17:07:00.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "22234"
          }
        }
      }
    },
    {
      "id": "22232",
      "type": "companies",
      "attributes": {
        "name": "Organization201",
        "default_currency": "USD",
        "created_at": "2018-06-08T17:07:00.081+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "22234",
      "type": "companies",
      "attributes": {
        "name": "Client285",
        "default_currency": null,
        "created_at": "2018-06-08T17:07:00.207+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/expenses/28

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":