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


Content Negotiation

Content-Type header must be set to application/vnd.api+json.

While sending bulk requests, make sure to set Content-Type to application/vnd.api+json; ext=bulk.

When Content-Type is not set as described, API will return 415 response status error.


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.


Filtering

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. In case you set filter parameter that is not supported for the query, you will get 400 status error:

{
    "errors": [
        {
            "status": 400,
            "title": "Unsupported Filter",
            "detail": "Filter 'undefined' is not supported on this endpoint"
        }
    ]
}

Sorting

To sort query results, you can use sort parameter, passing available sort params for the resource: ?sort=name. All available sort params are defined separately for each resource. You can provide desired sort order using - sign (?sort=-name), where no - defines ascending and - defines descending order by the given sort parameter. If a given parameter is not supported, Unsupported Sort error (with status 400) will be raised:

{
    "errors": [
        {
            "status": 400,
            "title": "Unsupported Sort",
            "detail": "Sort by 'unsupported' is not supported on this endpoint"
        }
    ]
}

Aggregation

Some endpoints have available ?aggregates param. All available aggregation params are listed under each resource. In the case when aggregates param is present in the query, meta property of the response will include aggregates property with requested fields included (if available). If a given parameter is not available for the resource, Unsupported Aggregate error will be raised:

{
    "errors": [
        {
            "status": 400,
            "title": "Unsupported Aggregate",
            "detail": "Aggregate 'unavailable' is not supported on this endpoint"
        }
    ]
}

Errors

400

Used when a given query param is not supported. Possible title values: Unsupported Filter, Unsupported Filter Value, Unsupported Sort, Unsupported Aggregate, Unsupported Group

{
    "errors": [
        {
            "status": 400,
            "title": "*one of listed values*",
            "detail": "*...* is not supported on this endpoint"
        }
    ]
}

401

{
    "errors": [
        {
            "status": 401,
            "title": "Unauthenticated",
            "detail": "You are not authenticated"
        }
    ]
}

403

{
    "errors": [
        {
            "status": 403,
            "title": "Access Denied",
            "detail": "You are not authorized to access this resource"
        }
    ]
}

404

{
    "errors": [
        {
            "status": 404,
            "title": "Record Not Found",
            "detail": "The requested record was not found"
        }
    ]
}

406

{
    "errors": [
        {
            "status": 406,
            "title": "Not Acceptable",
            "detail": "The request was not accepted"
        }
    ]
}

415

{
    "errors": [
        {
            "status": 415,
            "title": "Unsupported Media Type",
            "detail": "Unsupported content type"
        }
    ]
}

422

{
    "errors": [
        {
            "status": 422,
            "title": "Invalid Attribute",
            "detail": "Unsupported content type"
        }
    ]
}

500

{
    "errors": [
        {
            "status": 500,
            "title": "Server Error",
            "detail": "An error occured on the server"
        }
    ]
}


Activities

Activities

Supported filter params

  • task_id

  • project_id

  • deal_id

  • invoice_id

  • company_id

  • person_id

  • creator_id

  • pinned

  • has_attachments

  • parent_type (1: Comment, 2: Changeset, 3: Email)

  • root_type (1: Comment, 2: Changeset, 3: Email)

  • after

  • before

GET /api/v2/activities
Requestsreturns activities

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

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": "",
        "changeset": [],
        "item_id": 88,
        "item_type": "task",
        "item_name": "#1: Ticket title",
        "item_deleted_at": null,
        "parent_id": 326,
        "parent_type": "project",
        "parent_name": "test project",
        "parent_deleted_at": null,
        "root_id": 326,
        "root_type": "project",
        "root_name": "test project",
        "root_deleted_at": null,
        "deal_is_budget": false,
        "task_id": 88,
        "deal_id": null,
        "invoice_id": null,
        "company_id": null,
        "person_id": null,
        "created_at": "2019-02-04T10:26:13.450+01:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1284"
          }
        },
        "comment": {
          "data": null
        },
        "email": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1284",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user87@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:13.000+01:00",
        "last_seen_at": "2019-02-04T10:26:13.460+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1758"
          }
        }
      }
    },
    {
      "id": "1758",
      "type": "companies",
      "attributes": {
        "name": "Organization62",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:13.150+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/activities?filter%5Btask_id%5D=88&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": "",
      "changeset": [],
      "item_id": 93,
      "item_type": "task",
      "item_name": "#1: Ticket title",
      "item_deleted_at": null,
      "parent_id": 341,
      "parent_type": "project",
      "parent_name": "test project",
      "parent_deleted_at": null,
      "root_id": 341,
      "root_type": "project",
      "root_name": "test project",
      "root_deleted_at": null,
      "deal_is_budget": false,
      "task_id": 93,
      "deal_id": null,
      "invoice_id": null,
      "company_id": null,
      "person_id": null,
      "created_at": "2019-02-04T10:26:15.715+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1314"
        }
      },
      "comment": {
        "data": null
      },
      "email": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1314",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user117@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:15.000+01:00",
        "last_seen_at": "2019-02-04T10:26:15.721+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1803"
          }
        }
      }
    },
    {
      "id": "1803",
      "type": "companies",
      "attributes": {
        "name": "Organization65",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:15.429+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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
Requestsreturns attachments

GET  /api/v2/attachments?filter[comment_id]=23

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "14",
      "type": "attachments",
      "attributes": {
        "name": "img.png",
        "type": "image/png",
        "content_type": "image/png",
        "size": 3479,
        "url": "/system/attachments/files/000/000/014/original/img.png?1549272375",
        "thumb": "/system/attachments/files/000/000/014/thumb/img.png?1549272375",
        "temp_url": null,
        "processed": false,
        "attachable_type": "comment",
        "aws_policy": {
          "key": "uploads/e8752dd68d097e9fd5b9e4f14f50f5b2/img.png",
          "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
          "acl": "public-read",
          "success_action_status": "201",
          "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMi0wNFQxOToyNjoxNVoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
          "signature": "5NTpuzePtUhZypnSRYT42vwYGdc=",
          "Content-Type": "image/png"
        }
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1320"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1320",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user123@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:15.000+01:00",
        "last_seen_at": "2019-02-04T10:26:15.892+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1812"
          }
        }
      }
    },
    {
      "id": "1812",
      "type": "companies",
      "attributes": {
        "name": "Organization66",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:15.796+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/attachments?filter%5Bcomment_id%5D=23&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/attachments?filter%5Bcomment_id%5D=23&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 attachments
GET/api/v2/attachments


GET /api/v2/attachments/1
Requestsreturns attachment

GET  /api/v2/attachments/15

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": "image/png",
      "content_type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/015/original/img.png?1549272376",
      "thumb": "/system/attachments/files/000/000/015/thumb/img.png?1549272376",
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/be45ba366701ce719148953f04b438cf/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMi0wNFQxOToyNjoxNloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "Xiqx7gVlIO1M+T+38J0WDGqmqy4=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1321"
        }
      }
    }
  },
  "included": [
    {
      "id": "1321",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user124@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:16.000+01:00",
        "last_seen_at": "2019-02-04T10:26:16.062+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1814"
          }
        }
      }
    },
    {
      "id": "1814",
      "type": "companies",
      "attributes": {
        "name": "Organization67",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:15.980+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "25",
      "attachable_type": "comment"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": null,
      "content_type": null,
      "size": null,
      "url": "/system/attachments/files/000/000/017/original/img.png",
      "thumb": null,
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/3308d1357142dc4e1729346ed8400a70/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMi0wNFQxOToyNjoxNloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "Xiqx7gVlIO1M+T+38J0WDGqmqy4=",
        "Content-Type": null
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1322"
        }
      }
    }
  },
  "included": [
    {
      "id": "1322",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user125@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:16.000+01:00",
        "last_seen_at": "2019-02-04T10:26:16.214+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1816"
          }
        }
      }
    },
    {
      "id": "1816",
      "type": "companies",
      "attributes": {
        "name": "Organization68",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:16.130+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/19

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": "19",
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "type": "image/png",
      "content_type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/019/original/img.png?1549272376",
      "thumb": "/system/attachments/files/000/000/019/thumb/img.png?1549272376",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/9979ba82554d83720250859d7372664c/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMi0wNFQxOToyNjoxNloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "Xiqx7gVlIO1M+T+38J0WDGqmqy4=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1324"
        }
      }
    }
  },
  "included": [
    {
      "id": "1324",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user127@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:16.000+01:00",
        "last_seen_at": "2019-02-04T10:26:16.497+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1820"
          }
        }
      }
    },
    {
      "id": "1820",
      "type": "companies",
      "attributes": {
        "name": "Organization70",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:16.415+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/attachments/20

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

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


Boards

Boards

Supported filter params

  • id

  • project_id

GET /api/v2/boards
Requestsreturns boards

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "106",
      "type": "boards",
      "attributes": {
        "name": "board name",
        "position": 1,
        "archived_at": null
      },
      "relationships": {
        "project": {
          "data": {
            "type": "projects",
            "id": "344"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "344",
      "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,
        "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": "1828"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1328"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1828",
      "type": "companies",
      "attributes": {
        "name": "Client92",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:16.896+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1328",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user131@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:16.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1827"
          }
        }
      }
    },
    {
      "id": "1827",
      "type": "companies",
      "attributes": {
        "name": "Client91",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:16.885+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/boards?filter%5Bproject_id%5D=344&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/boards?filter%5Bproject_id%5D=344&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/107

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "107",
    "type": "boards",
    "attributes": {
      "name": "board name",
      "position": 1,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "345"
        }
      }
    }
  },
  "included": [
    {
      "id": "345",
      "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,
        "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": "1831"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1330"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1831",
      "type": "companies",
      "attributes": {
        "name": "Client94",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:17.119+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1330",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user133@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:17.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1830"
          }
        }
      }
    },
    {
      "id": "1830",
      "type": "companies",
      "attributes": {
        "name": "Client93",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:17.105+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "346"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "109",
    "type": "boards",
    "attributes": {
      "name": "test name",
      "position": 2,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "346"
        }
      }
    }
  },
  "included": [
    {
      "id": "346",
      "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,
        "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": "1834"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1332"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1834",
      "type": "companies",
      "attributes": {
        "name": "Client96",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:17.306+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1332",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user135@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:17.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1833"
          }
        }
      }
    },
    {
      "id": "1833",
      "type": "companies",
      "attributes": {
        "name": "Client95",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:17.296+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/112

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": "112",
    "type": "boards",
    "attributes": {
      "name": "new name",
      "position": 1,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "349"
        }
      }
    }
  },
  "included": [
    {
      "id": "349",
      "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,
        "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": "1843"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1338"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1843",
      "type": "companies",
      "attributes": {
        "name": "Client102",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:17.762+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1338",
      "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": "2019-02-04T10:26:17.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1842"
          }
        }
      }
    },
    {
      "id": "1842",
      "type": "companies",
      "attributes": {
        "name": "Client101",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:17.753+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/boards/113

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "115",
    "type": "boards",
    "attributes": {
      "name": "board name",
      "position": null,
      "archived_at": "2019-02-04T09:26:18.340Z"
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "352"
        }
      }
    }
  },
  "included": [
    {
      "id": "352",
      "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,
        "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": "1852"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1344"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1852",
      "type": "companies",
      "attributes": {
        "name": "Client108",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.240+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1344",
      "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": "2019-02-04T10:26:18.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1851"
          }
        }
      }
    },
    {
      "id": "1851",
      "type": "companies",
      "attributes": {
        "name": "Client107",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.230+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/116/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "116",
    "type": "boards",
    "attributes": {
      "name": "Board11",
      "position": 2,
      "archived_at": null
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "353"
        }
      }
    }
  },
  "included": [
    {
      "id": "353",
      "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,
        "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": "1855"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1346"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1855",
      "type": "companies",
      "attributes": {
        "name": "Client110",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.484+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1346",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user149@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:18.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1854"
          }
        }
      }
    },
    {
      "id": "1854",
      "type": "companies",
      "attributes": {
        "name": "Client109",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.472+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "2019-02-04",
        "ended_on": "2019-02-04",
        "note": null,
        "total_hours": 0,
        "total_time": 0,
        "created_at": "2019-02-04T10:26:18.700+01:00",
        "updated_at": "2019-02-04T10:26:18.700+01:00"
      },
      "relationships": {
        "service": {
          "data": null
        },
        "event": {
          "data": {
            "type": "events",
            "id": "8"
          }
        },
        "person": {
          "data": {
            "type": "people",
            "id": "1348"
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "1347"
          }
        },
        "updater": {
          "data": {
            "type": "people",
            "id": "1347"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "8",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 578
          }
        }
      }
    },
    {
      "id": "1348",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user151@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:18.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1857"
          }
        }
      }
    },
    {
      "id": "1347",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user150@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:18.000+01:00",
        "last_seen_at": "2019-02-04T10:26:18.712+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1856"
          }
        }
      }
    },
    {
      "id": "1857",
      "type": "companies",
      "attributes": {
        "name": "Client111",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.670+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1856",
      "type": "companies",
      "attributes": {
        "name": "Organization83",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:18.646+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "2019-02-04",
      "ended_on": "2019-02-04",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2019-02-04T10:26:18.825+01:00",
      "updated_at": "2019-02-04T10:26:18.825+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "9"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1350"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1349"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1349"
        }
      }
    }
  },
  "included": [
    {
      "id": "9",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 579
          }
        }
      }
    },
    {
      "id": "1350",
      "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": "2019-02-04T10:26:18.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1859"
          }
        }
      }
    },
    {
      "id": "1349",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user152@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:18.000+01:00",
        "last_seen_at": "2019-02-04T10:26:18.832+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1858"
          }
        }
      }
    },
    {
      "id": "1859",
      "type": "companies",
      "attributes": {
        "name": "Client112",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.812+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1858",
      "type": "companies",
      "attributes": {
        "name": "Organization84",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:18.792+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

booking id


POST /api/v2/bookings
Requestscreates the bookingreturns error

POST  /api/v2/bookings

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bookings",
    "attributes": {
      "started_on": "Feb  4, 2019",
      "ended_on": "Feb  4, 2019",
      "time": "360"
    },
    "relationships": {
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1352"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "bookings",
    "attributes": {
      "hours": 6,
      "time": 360,
      "started_on": "2019-02-04",
      "ended_on": "2019-02-04",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2019-02-04T10:26:18.961+01:00",
      "updated_at": "2019-02-04T10:26:18.961+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1352"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1351"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1351"
        }
      }
    }
  },
  "included": [
    {
      "id": "10",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 580
          }
        }
      }
    },
    {
      "id": "1352",
      "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": "2019-02-04T10:26:18.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1861"
          }
        }
      }
    },
    {
      "id": "1351",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user154@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:18.000+01:00",
        "last_seen_at": "2019-02-04T10:26:18.944+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1860"
          }
        }
      }
    },
    {
      "id": "1861",
      "type": "companies",
      "attributes": {
        "name": "Client113",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:18.922+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1860",
      "type": "companies",
      "attributes": {
        "name": "Organization85",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:18.904+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "2019-02-04",
      "ended_on": "2019-02-04",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2019-02-04T10:26:19.150+01:00",
      "updated_at": "2019-02-04T10:26:19.169+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "12"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1356"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1355"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1355"
        }
      }
    }
  },
  "included": [
    {
      "id": "12",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 582
          }
        }
      }
    },
    {
      "id": "1356",
      "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": "2019-02-04T10:26:19.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1865"
          }
        }
      }
    },
    {
      "id": "1355",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user158@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:19.000+01:00",
        "last_seen_at": "2019-02-04T10:26:19.159+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1864"
          }
        }
      }
    },
    {
      "id": "1865",
      "type": "companies",
      "attributes": {
        "name": "Client115",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:19.137+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1864",
      "type": "companies",
      "attributes": {
        "name": "Organization87",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:19.107+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/30

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "30",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2019-02-04T10:26:19.380+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1361"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1871"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1361",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user164@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:19.000+01:00",
        "last_seen_at": "2019-02-04T10:26:19.388+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1870"
          }
        }
      }
    },
    {
      "id": "1871",
      "type": "companies",
      "attributes": {
        "name": "Client118",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:19.376+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1870",
      "type": "companies",
      "attributes": {
        "name": "Organization90",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:19.363+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "32",
    "type": "comments",
    "attributes": {
      "commentable_type": "task",
      "body": null,
      "created_at": "2019-02-04T10:26:19.503+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1362"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": null
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1362",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user165@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:19.000+01:00",
        "last_seen_at": "2019-02-04T10:26:19.475+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1872"
          }
        }
      }
    },
    {
      "id": "1872",
      "type": "companies",
      "attributes": {
        "name": "Organization91",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:19.449+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/34

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": "34",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "new body",
      "created_at": "2019-02-04T10:26:19.618+01:00",
      "pinned_at": null,
      "edited_at": "2019-02-04T10:26:19.637+01:00",
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1364"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1877"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1364",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user167@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:19.000+01:00",
        "last_seen_at": "2019-02-04T10:26:19.627+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1876"
          }
        }
      }
    },
    {
      "id": "1877",
      "type": "companies",
      "attributes": {
        "name": "Client121",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:19.614+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1876",
      "type": "companies",
      "attributes": {
        "name": "Organization93",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:19.601+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/36/pin

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "36",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2019-02-04T10:26:19.805+01:00",
      "pinned_at": "2019-02-04T10:26:19.814+01:00",
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1366"
        }
      },
      "pinned_by": {
        "data": {
          "type": "people",
          "id": "1366"
        }
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1881"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1366",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user169@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:19.000+01:00",
        "last_seen_at": "2019-02-04T10:26:19.811+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1880"
          }
        }
      }
    },
    {
      "id": "1881",
      "type": "companies",
      "attributes": {
        "name": "Client123",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:19.801+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1880",
      "type": "companies",
      "attributes": {
        "name": "Organization95",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:19.789+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/comments/37/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/38/unpin

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "38",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2019-02-04T10:26:19.942+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1368"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1885"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1368",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user171@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:19.000+01:00",
        "last_seen_at": "2019-02-04T10:26:19.951+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1884"
          }
        }
      }
    },
    {
      "id": "1885",
      "type": "companies",
      "attributes": {
        "name": "Client125",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:19.938+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1884",
      "type": "companies",
      "attributes": {
        "name": "Organization97",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:19.926+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/comments/39/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/40

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": "1891",
      "type": "companies",
      "attributes": {
        "name": "Client128",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:20.132+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1890",
      "type": "companies",
      "attributes": {
        "name": "Organization100",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:20.118+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/1893

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1893",
    "type": "companies",
    "attributes": {
      "name": "Client129",
      "default_currency": null,
      "created_at": "2019-02-04T10:26:20.198+01:00",
      "archived_at": null,
      "avatar_url": null,
      "invoice_email_recipients": {},
      "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": "1896",
    "type": "companies",
    "attributes": {
      "name": "test name",
      "default_currency": null,
      "created_at": "2019-02-04T10:26:20.277+01:00",
      "archived_at": null,
      "avatar_url": null,
      "invoice_email_recipients": {},
      "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/1900

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": "1376"
          },
          {
            "type": "people",
            "id": "1377"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1900",
    "type": "companies",
    "attributes": {
      "name": "new name",
      "default_currency": null,
      "created_at": "2019-02-04T10:26:20.372+01:00",
      "archived_at": null,
      "avatar_url": null,
      "invoice_email_recipients": {},
      "description": null,
      "due_days": null,
      "tag_list": [
        "design",
        "IT"
      ]
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/companies/1904

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1906",
    "type": "companies",
    "attributes": {
      "name": "Client136",
      "default_currency": null,
      "created_at": "2019-02-04T10:26:20.615+01:00",
      "archived_at": "2019-02-04T10:26:20.000+01:00",
      "avatar_url": null,
      "invoice_email_recipients": {},
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/companies/1908/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/1910/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/1912/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1912",
    "type": "companies",
    "attributes": {
      "name": "Client139",
      "default_currency": null,
      "created_at": "2019-02-04T10:26:20.757+01:00",
      "archived_at": null,
      "avatar_url": null,
      "invoice_email_recipients": {},
      "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": "65",
      "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": "1914"
          }
        },
        "person": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "subsidiary": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 605
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1914",
      "type": "companies",
      "attributes": {
        "name": "Client140",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:20.814+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/66

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "66",
    "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": "1916"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 606
        }
      }
    }
  },
  "included": [
    {
      "id": "1916",
      "type": "companies",
      "attributes": {
        "name": "Client141",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:20.887+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "1918"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "68",
    "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": "1918"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 607
        }
      }
    }
  },
  "included": [
    {
      "id": "1918",
      "type": "companies",
      "attributes": {
        "name": "Client142",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:20.979+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/77

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": "77",
    "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": "1931"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 613
        }
      }
    }
  },
  "included": [
    {
      "id": "1931",
      "type": "companies",
      "attributes": {
        "name": "Client149",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:21.752+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/contact_entries/78

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

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": "149"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "149",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-02-04",
        "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": "93c37cb55f79b9b357077b76dae4bd22",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2019-02-04T10:26:22.069+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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1398"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1942"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1399"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "63"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1398",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user201@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,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1941"
          }
        }
      }
    },
    {
      "id": "1942",
      "type": "companies",
      "attributes": {
        "name": "Client155",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:22.044+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1399",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user202@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:22.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1943"
          }
        }
      }
    },
    {
      "id": "63",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 618
          }
        }
      }
    },
    {
      "id": "1941",
      "type": "companies",
      "attributes": {
        "name": "Organization123",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:22.023+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1943",
      "type": "companies",
      "attributes": {
        "name": "Client156",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:22.051+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "150"
        }
      }
    }
  },
  "included": [
    {
      "id": "150",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-02-04",
        "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": "43685f7ee161fd2df520c717891fa86d",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2019-02-04T10:26:22.234+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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1400"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1945"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1401"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "64"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1400",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user203@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,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1944"
          }
        }
      }
    },
    {
      "id": "1945",
      "type": "companies",
      "attributes": {
        "name": "Client157",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:22.207+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1401",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user204@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:22.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1946"
          }
        }
      }
    },
    {
      "id": "64",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 619
          }
        }
      }
    },
    {
      "id": "1944",
      "type": "companies",
      "attributes": {
        "name": "Organization124",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:22.193+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1946",
      "type": "companies",
      "attributes": {
        "name": "Client158",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:22.214+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "152"
        }
      }
    }
  }
}
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": "152"
        }
      }
    }
  },
  "included": [
    {
      "id": "152",
      "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": "9dbd22c7fd55cee6ad42f78d4dfc46b4",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1402"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1950"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1404"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": {
            "type": "projects",
            "id": "354"
          }
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": {
            "type": "contracts",
            "id": "16"
          }
        }
      }
    },
    {
      "id": "1402",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user205@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,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1947"
          }
        }
      }
    },
    {
      "id": "1950",
      "type": "companies",
      "attributes": {
        "name": "Client161",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1404",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user207@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,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1951"
          }
        }
      }
    },
    {
      "id": "354",
      "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": 1,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": "2017-01-31",
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "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": "1953"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1405"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "1947",
      "type": "companies",
      "attributes": {
        "name": "Organization125",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:22.348+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1951",
      "type": "companies",
      "attributes": {
        "name": "Client162",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1953",
      "type": "companies",
      "attributes": {
        "name": "Client164",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1405",
      "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": "2017-01-01T15:00:00.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1952"
          }
        }
      }
    },
    {
      "id": "1952",
      "type": "companies",
      "attributes": {
        "name": "Client163",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "157"
        }
      }
    }
  },
  "included": [
    {
      "id": "157",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-02-04",
        "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": "0271a7a2a7128c34a2f1abacc00ff4fa",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2019-02-04T10:26:23.081+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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1413"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1966"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1414"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "70"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1413",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user216@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,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1965"
          }
        }
      }
    },
    {
      "id": "1966",
      "type": "companies",
      "attributes": {
        "name": "Client173",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:23.052+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1414",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user217@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:23.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1967"
          }
        }
      }
    },
    {
      "id": "70",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 624
          }
        }
      }
    },
    {
      "id": "1965",
      "type": "companies",
      "attributes": {
        "name": "Organization129",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:23.037+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1967",
      "type": "companies",
      "attributes": {
        "name": "Client174",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:23.060+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "1427"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1427",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user230@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:23.000+01:00",
        "last_seen_at": "2019-02-04T10:26:23.883+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1989"
          }
        }
      }
    },
    {
      "id": "1989",
      "type": "companies",
      "attributes": {
        "name": "Organization133",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:23.848+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "1428"
        }
      }
    }
  },
  "included": [
    {
      "id": "1428",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user231@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:23.000+01:00",
        "last_seen_at": "2019-02-04T10:26:23.970+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1990"
          }
        }
      }
    },
    {
      "id": "1990",
      "type": "companies",
      "attributes": {
        "name": "Organization135",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:23.939+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "1430"
        }
      }
    }
  },
  "included": [
    {
      "id": "1430",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user233@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:24.000+01:00",
        "last_seen_at": "2019-02-04T10:26:24.108+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1992"
          }
        }
      }
    },
    {
      "id": "1992",
      "type": "companies",
      "attributes": {
        "name": "Organization139",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:24.082+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "74",
      "type": "deal_statuses",
      "attributes": {
        "name": "test deal status",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 640
          }
        }
      }
    }
  ],
  "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": 1,
    "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/75

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

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": "77",
    "type": "deal_statuses",
    "attributes": {
      "name": "test name",
      "position": 2,
      "deleted_at": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 642
        }
      }
    }
  }
}

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

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": "79",
    "type": "deal_statuses",
    "attributes": {
      "name": "new name",
      "position": 1,
      "deleted_at": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 644
        }
      }
    }
  }
}

PATCH  /api/v2/deal_statuses/80

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
Requestsarchives deal_statusreturns error

DELETE  /api/v2/deal_statuses/81

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

DELETE  /api/v2/deal_statuses/82

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)

  • 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)

  • project_type (1: internal project, 2: client project)

  • budget_status (1: open, 2: closed)

  • date_after

  • date_before

  • subsidiary_id

Supported sort params

  • name

  • date

  • end_date

  • number

  • suffix

  • discount

  • time_approval

  • client_access

  • purchase_order_number

  • budget_warning

  • closed_at

  • created_at

  • last_activity_at

  • probability

  • billable_time

  • estimated_time

  • budgeted_time

  • total_budgeted_time

  • worked_time

  • revenue

  • services_revenue

  • cost

  • work_cost

  • profit

  • profit_margin

  • invoiced

  • pending_invoicing

  • paid

  • expense

  • expense_reimbursable

  • expense_paid

  • budget_total

  • budget_used

  • company.name

  • project.name

  • responsible.name

  • actual_rate

  • estimated_remaining_time

Supported aggregates params

  • total_revenue

  • total_expense_reimbursable

  • total_services_revenue

  • total_work_cost

  • total_expense

  • total_cost

  • total_profit

  • total_budget_total

  • total_budget_used

  • total_invoiced

  • total_pending_invoicing

  • average_actual_rate

  • total_worked_time

  • total_billable_time

  • total_estimated_time

  • total_budgeted_time

  • average_time_to_close

  • total_estimated_remaining_time

  • average_rate

Supported Enumerations

Deal type:

  • internal (deal_type_id: 1)

  • client (deal_type_id: 2)

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": "166",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-02-04",
        "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": "23d3a72ccf9972bcd315b8be13931301",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2019-02-04T10:26:25.009+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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1445"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2010"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1446"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "87"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1445",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user248@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:25.000+01:00",
        "last_seen_at": "2019-02-04T10:26:25.026+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2009"
          }
        }
      }
    },
    {
      "id": "2010",
      "type": "companies",
      "attributes": {
        "name": "Client197",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:24.952+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1446",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user249@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:24.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2011"
          }
        }
      }
    },
    {
      "id": "87",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 650
          }
        }
      }
    },
    {
      "id": "2009",
      "type": "companies",
      "attributes": {
        "name": "Organization155",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:24.934+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2011",
      "type": "companies",
      "attributes": {
        "name": "Client198",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:24.963+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/167

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "167",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-02-04",
      "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": "7f810cbe25c814b52e9076ed1ac1d8c7",
      "purchase_order_number": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "budgeted_time": 0,
      "worked_time": 0,
      "time_to_close": null,
      "unapproved_entries_count": 0,
      "estimated_remaining_time": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2019-02-04T10:26:25.152+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,
      "services_revenue": 0,
      "services_revenue_default": 0,
      "services_revenue_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "work_cost": 0,
      "work_cost_default": 0,
      "work_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_reimbursable": 0,
      "expense_reimbursable_default": 0,
      "expense_reimbursable_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0,
      "budget_total": 0,
      "budget_total_default": 0,
      "budget_total_normalized": 0,
      "budget_used": 0,
      "budget_used_default": 0,
      "budget_used_normalized": 0,
      "actual_rate": 0,
      "actual_rate_default": 0,
      "actual_rate_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1447"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2013"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1448"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "88"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1447",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user250@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:25.000+01:00",
        "last_seen_at": "2019-02-04T10:26:25.165+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2012"
          }
        }
      }
    },
    {
      "id": "2013",
      "type": "companies",
      "attributes": {
        "name": "Client199",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:25.125+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1448",
      "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": "2019-02-04T10:26:25.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2014"
          }
        }
      }
    },
    {
      "id": "88",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 651
          }
        }
      }
    },
    {
      "id": "2012",
      "type": "companies",
      "attributes": {
        "name": "Organization156",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:25.111+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2014",
      "type": "companies",
      "attributes": {
        "name": "Client200",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:25.134+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

deal id


POST /api/v2/deals
Requestscreates dealreturns error

POST  /api/v2/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "Feb  4, 2019",
      "deal_type_id": "2",
      "deal_status_id": "89",
      "sales_status_id": "1",
      "probability": "50",
      "currency": "EUR"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "2016"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1451"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "169",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-02-04",
      "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": "2019-02-04T10:26:25.000+01:00",
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "email_key": "5fea3f1a5f9d266ddbb7f129deb41738",
      "purchase_order_number": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "budgeted_time": 0,
      "worked_time": 0,
      "time_to_close": null,
      "unapproved_entries_count": 0,
      "estimated_remaining_time": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2019-02-04T10:26:25.354+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,
      "services_revenue": 0,
      "services_revenue_default": 0,
      "services_revenue_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "work_cost": 0,
      "work_cost_default": 0,
      "work_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_reimbursable": 0,
      "expense_reimbursable_default": 0,
      "expense_reimbursable_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0,
      "budget_total": 0,
      "budget_total_default": 0,
      "budget_total_normalized": 0,
      "budget_used": 0,
      "budget_used_default": 0,
      "budget_used_normalized": 0,
      "actual_rate": 0,
      "actual_rate_default": 0,
      "actual_rate_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1449"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2016"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1451"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "89"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1449",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user252@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:25.000+01:00",
        "last_seen_at": "2019-02-04T10:26:25.324+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2015"
          }
        }
      }
    },
    {
      "id": "2016",
      "type": "companies",
      "attributes": {
        "name": "Client201",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:25.268+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1451",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user254@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2019-02-04T10:26:25.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2018"
          }
        }
      }
    },
    {
      "id": "89",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 652
          }
        }
      }
    },
    {
      "id": "2015",
      "type": "companies",
      "attributes": {
        "name": "Organization157",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:25.255+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2018",
      "type": "companies",
      "attributes": {
        "name": "Client203",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:25.310+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/172

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": "1458"
        }
      },
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "1459"
          },
          {
            "type": "people",
            "id": "1460"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "172",
    "type": "deals",
    "attributes": {
      "name": "new name",
      "date": "2019-02-04",
      "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": "5a0ccdcfadb74ac3b0c8f7453f2d989e",
      "purchase_order_number": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "budgeted_time": 0,
      "worked_time": 0,
      "time_to_close": null,
      "unapproved_entries_count": 0,
      "estimated_remaining_time": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2019-02-04T10:26:25.734+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,
      "services_revenue": 0,
      "services_revenue_default": 0,
      "services_revenue_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "work_cost": 0,
      "work_cost_default": 0,
      "work_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_reimbursable": 0,
      "expense_reimbursable_default": 0,
      "expense_reimbursable_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0,
      "budget_total": 0,
      "budget_total_default": 0,
      "budget_total_normalized": 0,
      "budget_used": 0,
      "budget_used_default": 0,
      "budget_used_normalized": 0,
      "actual_rate": 0,
      "actual_rate_default": 0,
      "actual_rate_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1456"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2026"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1458"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "92"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1456",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user259@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:25.000+01:00",
        "last_seen_at": "2019-02-04T10:26:25.846+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2025"
          }
        }
      }
    },
    {
      "id": "2026",
      "type": "companies",
      "attributes": {
        "name": "Client208",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:25.694+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1458",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user261@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2019-02-04T10:26:25.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2028"
          }
        }
      }
    },
    {
      "id": "92",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 655
          }
        }
      }
    },
    {
      "id": "2025",
      "type": "companies",
      "attributes": {
        "name": "Organization160",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:25.682+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2028",
      "type": "companies",
      "attributes": {
        "name": "Client210",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:25.781+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/deals/173

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

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "192",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-02-04",
      "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": "d664d3da91e2a6d92e09bb51de89c8fd",
      "purchase_order_number": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "budgeted_time": 0,
      "worked_time": 0,
      "time_to_close": null,
      "unapproved_entries_count": 0,
      "estimated_remaining_time": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2019-02-04T10:26:28.922+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,
      "services_revenue": 0,
      "services_revenue_default": 0,
      "services_revenue_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "work_cost": 0,
      "work_cost_default": 0,
      "work_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_reimbursable": 0,
      "expense_reimbursable_default": 0,
      "expense_reimbursable_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0,
      "budget_total": 0,
      "budget_total_default": 0,
      "budget_total_normalized": 0,
      "budget_used": 0,
      "budget_used_default": 0,
      "budget_used_normalized": 0,
      "actual_rate": 0,
      "actual_rate_default": 0,
      "actual_rate_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1492"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2083"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1494"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": {
          "type": "projects",
          "id": "363"
        }
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1492",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user295@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:28.000+01:00",
        "last_seen_at": "2019-02-04T10:26:28.937+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2080"
          }
        }
      }
    },
    {
      "id": "2083",
      "type": "companies",
      "attributes": {
        "name": "Client254",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:28.825+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1494",
      "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": "2019-02-04T10:26:28.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2084"
          }
        }
      }
    },
    {
      "id": "363",
      "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": 1,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "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": "2086"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1495"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2080",
      "type": "companies",
      "attributes": {
        "name": "Organization171",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:28.775+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2084",
      "type": "companies",
      "attributes": {
        "name": "Client255",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:28.832+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2086",
      "type": "companies",
      "attributes": {
        "name": "Client257",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:28.854+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1495",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user298@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:28.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2085"
          }
        }
      }
    },
    {
      "id": "2085",
      "type": "companies",
      "attributes": {
        "name": "Client256",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:28.845+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/194/close

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "194",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-02-04",
      "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": "a1c02e597aacd62a9a199923a1d38d21",
      "purchase_order_number": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "budgeted_time": 0,
      "worked_time": 0,
      "time_to_close": null,
      "unapproved_entries_count": 0,
      "estimated_remaining_time": 0,
      "lost_comment": null,
      "closed_at": "2019-02-04T10:26:29.304+01:00",
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2019-02-04T10:26:29.283+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,
      "services_revenue": 0,
      "services_revenue_default": 0,
      "services_revenue_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "work_cost": 0,
      "work_cost_default": 0,
      "work_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_reimbursable": 0,
      "expense_reimbursable_default": 0,
      "expense_reimbursable_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0,
      "budget_total": 0,
      "budget_total_default": 0,
      "budget_total_normalized": 0,
      "budget_used": 0,
      "budget_used_default": 0,
      "budget_used_normalized": 0,
      "actual_rate": 0,
      "actual_rate_default": 0,
      "actual_rate_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1496"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2090"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1498"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": {
          "type": "projects",
          "id": "364"
        }
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1496",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user299@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:29.000+01:00",
        "last_seen_at": "2019-02-04T10:26:29.297+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2087"
          }
        }
      }
    },
    {
      "id": "2090",
      "type": "companies",
      "attributes": {
        "name": "Client260",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:29.166+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1498",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user301@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:29.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2091"
          }
        }
      }
    },
    {
      "id": "364",
      "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,
        "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": "2093"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1499"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2087",
      "type": "companies",
      "attributes": {
        "name": "Organization172",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:29.107+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2091",
      "type": "companies",
      "attributes": {
        "name": "Client261",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:29.173+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2093",
      "type": "companies",
      "attributes": {
        "name": "Client263",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:29.197+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1499",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user302@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:29.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2092"
          }
        }
      }
    },
    {
      "id": "2092",
      "type": "companies",
      "attributes": {
        "name": "Client262",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:29.187+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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

Supported Enumerations

Apns server:

  • SandBox (apns_server_id: 1)

  • Labs (apns_server_id: 2)

  • AppStore (apns_server_id: 3)

POST /api/v2/devices
Requestscreates 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",
      "firebase_token": "firebasetoken",
      "unique_identifier": "unique_identifier1"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "unique_identifier": "unique_identifier1",
      "firebase_token": "firebasetoken"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1195"
        }
      }
    }
  },
  "included": [
    {
      "id": "1195",
      "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": 496,
        "default_organization_slug": "496-organization1",
        "intercom_hash": "276daece59edda76813837b9d54d83acc93319f86a4b8cbc0e6544756072b4b6",
        "beta_features": [],
        "sysadmin": false,
        "newsletter_consent": false,
        "newsletter_consent_at": null,
        "ical_token": null
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "firebase_token": "firebasetoken",
      "unique_identifier": "unique_identifier2"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "7",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "unique_identifier": "unique_identifier2",
      "firebase_token": "firebasetoken"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1196"
        }
      }
    }
  },
  "included": [
    {
      "id": "1196",
      "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": 497,
        "default_organization_slug": "497-organization2",
        "intercom_hash": "89c2747ab2762a91ddf7f04fe23f6cbb012ca914f04b023c99e03500684f280f",
        "beta_features": [],
        "sysadmin": false,
        "newsletter_consent": false,
        "newsletter_consent_at": null,
        "ical_token": 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/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

firebase_token
string (required) Example: abcd

firebase token


DELETE /api/v2/devices/1
Requestsdeletes device

DELETE  /api/v2/devices/8

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 (1: invoice, 2: deal, 3: budget)

  • 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.0",
        "tax2_name": null,
        "tax2_value": null,
        "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,
        "exporter_options": {},
        "email_template": null
      },
      "relationships": {
        "subsidiary": {
          "data": {
            "type": "subsidiaries",
            "id": "22"
          }
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 668
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "22",
      "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": 668
          }
        }
      }
    }
  ],
  "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.0",
      "tax2_name": null,
      "tax2_value": null,
      "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,
      "exporter_options": {},
      "email_template": null
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "23"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 669
        }
      }
    }
  },
  "included": [
    {
      "id": "23",
      "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": 669
          }
        }
      }
    }
  ]
}

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": "24"
        }
      }
    }
  }
}
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,
      "tax2_name": null,
      "tax2_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,
      "exporter_options": {},
      "email_template": null
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "24"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 670
        }
      }
    }
  },
  "included": [
    {
      "id": "24",
      "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": 670
          }
        }
      }
    }
  ]
}

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.0",
      "tax2_name": null,
      "tax2_value": null,
      "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,
      "exporter_options": {},
      "email_template": null
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "27"
        }
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 673
        }
      }
    }
  },
  "included": [
    {
      "id": "27",
      "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": 673
          }
        }
      }
    }
  ]
}

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.

Deletes 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": "17",
      "type": "emails",
      "attributes": {
        "subject": null,
        "body": "Email text body",
        "auto_linked": false,
        "linked_type": null,
        "linked_id": null,
        "dismissed_at": null,
        "created_at": "2019-02-04T10:26:30.185+01:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1510"
          }
        },
        "deal": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "recipients": {
          "data": []
        },
        "cc_recipients": {
          "data": []
        },
        "attachments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "1510",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user313@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:30.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2104"
          }
        }
      }
    },
    {
      "id": "2104",
      "type": "companies",
      "attributes": {
        "name": "Client264",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:30.156+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/19

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "19",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "linked_type": null,
      "linked_id": null,
      "dismissed_at": null,
      "created_at": "2019-02-04T10:26:30.502+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1514"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1514",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user317@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:30.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2108"
          }
        }
      }
    },
    {
      "id": "2108",
      "type": "companies",
      "attributes": {
        "name": "Client266",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:30.490+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/20/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "emails",
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "195"
        }
      }
    }
  }
}
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": "Quote",
      "linked_id": 195,
      "dismissed_at": null,
      "created_at": "2019-02-04T10:26:30.621+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1516"
        }
      },
      "deal": {
        "data": {
          "type": "deals",
          "id": "195"
        }
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1516",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user319@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:30.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2110"
          }
        }
      }
    },
    {
      "id": "195",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-02-04",
        "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": "b5275ce5d52d27827dab596e8f12f458",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2019-02-04T10:26:30.664+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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1515"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2111"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1517"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "110"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "2110",
      "type": "companies",
      "attributes": {
        "name": "Client267",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:30.611+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1515",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user318@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:30.000+01:00",
        "last_seen_at": "2019-02-04T10:26:30.682+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2109"
          }
        }
      }
    },
    {
      "id": "2111",
      "type": "companies",
      "attributes": {
        "name": "Client268",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:30.624+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1517",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user320@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:30.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2112"
          }
        }
      }
    },
    {
      "id": "110",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 680
          }
        }
      }
    },
    {
      "id": "2109",
      "type": "companies",
      "attributes": {
        "name": "Organization185",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:30.592+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2112",
      "type": "companies",
      "attributes": {
        "name": "Client269",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:30.631+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/emails/21/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/24/dismiss

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "24",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "linked_type": null,
      "linked_id": null,
      "dismissed_at": "2019-02-04T10:26:31.216+01:00",
      "created_at": "2019-02-04T10:26:31.205+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1526"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1526",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user329@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:31.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2122"
          }
        }
      }
    },
    {
      "id": "2122",
      "type": "companies",
      "attributes": {
        "name": "Client275",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:31.196+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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/27

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

  • service_type_id

  • company_id

  • project_id

  • date_after

  • date_before

  • pay_on_after

  • pay_on_before

  • paid_on_after

  • paid_on_before

  • status (1: paid, 2: unpaid)

Supported sort params

Supported aggregates params

  • total_amount

  • total_reimbursable_amount

  • total_profit

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": "2019-02-04",
        "pay_on": null,
        "paid_on": null,
        "position": 1,
        "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": "197"
          }
        },
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "88"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "197",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-02-04",
        "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": "830c404dff3fc8d496ac347b0f4e0cc8",
        "purchase_order_number": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "budgeted_time": 0,
        "worked_time": 0,
        "time_to_close": null,
        "unapproved_entries_count": 0,
        "estimated_remaining_time": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2019-02-04T10:26:32.035+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,
        "services_revenue": 0,
        "services_revenue_default": 0,
        "services_revenue_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "work_cost": 0,
        "work_cost_default": 0,
        "work_cost_normalized": 0,
        "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_reimbursable": 0,
        "expense_reimbursable_default": 0,
        "expense_reimbursable_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0,
        "budget_total": 0,
        "budget_total_default": 0,
        "budget_total_normalized": 0,
        "budget_used": 0,
        "budget_used_default": 0,
        "budget_used_normalized": 0,
        "actual_rate": 0,
        "actual_rate_default": 0,
        "actual_rate_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1537"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2134"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1538"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": {
            "type": "projects",
            "id": "365"
          }
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "88",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 690
          }
        }
      }
    },
    {
      "id": "1537",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user340@email.com",
        "title": null,
        "joined_at": "2019-02-04T10:26:32.000+01:00",
        "last_seen_at": "2019-02-04T10:26:32.091+01:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2133"
          }
        }
      }
    },
    {
      "id": "2134",
      "type": "companies",
      "attributes": {
        "name": "Client281",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:31.886+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1538",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user341@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:31.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2135"
          }
        }
      }
    },
    {
      "id": "365",
      "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": 1,
        "worked_time": 0,
        "estimated_time": 0,
        "profit_margin": 0,
        "budget_closing_date": null,
        "budget_invoicing_date": null,
        "invoice_payment_due": null,
        "currency": "USD",
        "currency_default": "USD",
        "currency_normalized": "USD",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "cost": 12500,
        "cost_default": 12500,
        "cost_normalized": 12500,
        "profit": -12500,
        "profit_default": -12500,
        "profit_normalized": -12500,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2137"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1539"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2133",
      "type": "companies",
      "attributes": {
        "name": "Organization195",
        "default_currency": "USD",
        "created_at": "2019-02-04T10:26:31.862+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2135",
      "type": "companies",
      "attributes": {
        "name": "Client282",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:31.898+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2137",
      "type": "companies",
      "attributes": {
        "name": "Client284",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:31.936+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1539",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user342@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2019-02-04T10:26:31.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2136"
          }
        }
      }
    },
    {
      "id": "2136",
      "type": "companies",
      "attributes": {
        "name": "Client283",
        "default_currency": null,
        "created_at": "2019-02-04T10:26:31.920+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "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": "2019-02-04",
      "pay_on": null,
      "paid_on": null,
      "position": 1,
      "currency": "EUR",
      "currency_default":