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"
        }
    ]
}

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": 348,
        "parent_type": "project",
        "parent_name": "test project",
        "parent_deleted_at": null,
        "root_id": 348,
        "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-01-19T22:13:31.641+01:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1527"
          }
        },
        "comment": {
          "data": null
        },
        "email": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1527",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user87@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:31.000+01:00",
        "last_seen_at": "2019-01-19T22:13:31.657+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": "2119"
          }
        }
      }
    },
    {
      "id": "2119",
      "type": "companies",
      "attributes": {
        "name": "Organization62",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:31.179+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": 363,
      "parent_type": "project",
      "parent_name": "test project",
      "parent_deleted_at": null,
      "root_id": 363,
      "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-01-19T22:13:35.373+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1557"
        }
      },
      "comment": {
        "data": null
      },
      "email": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1557",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user117@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:35.000+01:00",
        "last_seen_at": "2019-01-19T22:13:35.384+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": "2164"
          }
        }
      }
    },
    {
      "id": "2164",
      "type": "companies",
      "attributes": {
        "name": "Organization65",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:34.951+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?1547932415",
        "thumb": "/system/attachments/files/000/000/014/thumb/img.png?1547932415",
        "temp_url": null,
        "processed": false,
        "attachable_type": "comment",
        "aws_policy": {
          "key": "uploads/c869719f4317a10b29a6b8248f26d154/img.png",
          "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
          "acl": "public-read",
          "success_action_status": "201",
          "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMS0yMFQwNzoxMzozNVoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
          "signature": "hJAfDSkLR8aCR01/O2KbOgqJUzg=",
          "Content-Type": "image/png"
        }
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1563"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1563",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user123@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:35.000+01:00",
        "last_seen_at": "2019-01-19T22:13:35.578+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": "2173"
          }
        }
      }
    },
    {
      "id": "2173",
      "type": "companies",
      "attributes": {
        "name": "Organization66",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:35.471+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?1547932415",
      "thumb": "/system/attachments/files/000/000/015/thumb/img.png?1547932415",
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/24a7ae4bde7f99e4db1b84d86700640b/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMS0yMFQwNzoxMzozNVoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "hJAfDSkLR8aCR01/O2KbOgqJUzg=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1564"
        }
      }
    }
  },
  "included": [
    {
      "id": "1564",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user124@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:35.000+01:00",
        "last_seen_at": "2019-01-19T22:13:35.778+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": "2175"
          }
        }
      }
    },
    {
      "id": "2175",
      "type": "companies",
      "attributes": {
        "name": "Organization67",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:35.685+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/40be1a678f9907095c04229b0ac26b3d/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMS0yMFQwNzoxMzozNloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "/g/sXohW8aqDaFB2Ie+KfT+DIE8=",
        "Content-Type": null
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1565"
        }
      }
    }
  },
  "included": [
    {
      "id": "1565",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user125@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:35.000+01:00",
        "last_seen_at": "2019-01-19T22:13:35.960+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": "2177"
          }
        }
      }
    },
    {
      "id": "2177",
      "type": "companies",
      "attributes": {
        "name": "Organization68",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:35.865+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?1547932416",
      "thumb": "/system/attachments/files/000/000/019/thumb/img.png?1547932416",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/597275db6ad2da2233a98002d99a721c/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxOS0wMS0yMFQwNzoxMzozNloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "/g/sXohW8aqDaFB2Ie+KfT+DIE8=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1567"
        }
      }
    }
  },
  "included": [
    {
      "id": "1567",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user127@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:36.000+01:00",
        "last_seen_at": "2019-01-19T22:13:36.322+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": "2181"
          }
        }
      }
    },
    {
      "id": "2181",
      "type": "companies",
      "attributes": {
        "name": "Organization70",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:36.225+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]=366

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": "366"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "366",
      "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": "2189"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1571"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2189",
      "type": "companies",
      "attributes": {
        "name": "Client92",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:36.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": "1571",
      "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-01-19T22:13:36.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2188"
          }
        }
      }
    },
    {
      "id": "2188",
      "type": "companies",
      "attributes": {
        "name": "Client91",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:36.817+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=366&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://test.host/api/v2/boards?filter%5Bproject_id%5D=366&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": "367"
        }
      }
    }
  },
  "included": [
    {
      "id": "367",
      "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": "2192"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1573"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2192",
      "type": "companies",
      "attributes": {
        "name": "Client94",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:37.103+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1573",
      "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-01-19T22:13:37.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2191"
          }
        }
      }
    },
    {
      "id": "2191",
      "type": "companies",
      "attributes": {
        "name": "Client93",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:37.089+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": "368"
        }
      }
    }
  }
}
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": "368"
        }
      }
    }
  },
  "included": [
    {
      "id": "368",
      "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": "2195"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1575"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2195",
      "type": "companies",
      "attributes": {
        "name": "Client96",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:37.360+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1575",
      "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-01-19T22:13:37.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2194"
          }
        }
      }
    },
    {
      "id": "2194",
      "type": "companies",
      "attributes": {
        "name": "Client95",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:37.347+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": "371"
        }
      }
    }
  },
  "included": [
    {
      "id": "371",
      "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": "2204"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1581"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2204",
      "type": "companies",
      "attributes": {
        "name": "Client102",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:38.041+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1581",
      "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-01-19T22:13:38.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2203"
          }
        }
      }
    },
    {
      "id": "2203",
      "type": "companies",
      "attributes": {
        "name": "Client101",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:38.028+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-01-19T21:13:38.813Z"
    },
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "374"
        }
      }
    }
  },
  "included": [
    {
      "id": "374",
      "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": "2213"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1587"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2213",
      "type": "companies",
      "attributes": {
        "name": "Client108",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:38.680+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1587",
      "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-01-19T22:13:38.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2212"
          }
        }
      }
    },
    {
      "id": "2212",
      "type": "companies",
      "attributes": {
        "name": "Client107",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:38.667+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": "375"
        }
      }
    }
  },
  "included": [
    {
      "id": "375",
      "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": "2216"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1589"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2216",
      "type": "companies",
      "attributes": {
        "name": "Client110",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:38.973+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1589",
      "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-01-19T22:13:38.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2215"
          }
        }
      }
    },
    {
      "id": "2215",
      "type": "companies",
      "attributes": {
        "name": "Client109",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:38.960+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-01-19",
        "ended_on": "2019-01-19",
        "note": null,
        "total_hours": 0,
        "total_time": 0,
        "created_at": "2019-01-19T22:13:39.294+01:00",
        "updated_at": "2019-01-19T22:13:39.294+01:00"
      },
      "relationships": {
        "service": {
          "data": null
        },
        "event": {
          "data": {
            "type": "events",
            "id": "8"
          }
        },
        "person": {
          "data": {
            "type": "people",
            "id": "1591"
          }
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "1590"
          }
        },
        "updater": {
          "data": {
            "type": "people",
            "id": "1590"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "8",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 720
          }
        }
      }
    },
    {
      "id": "1591",
      "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-01-19T22:13:39.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2218"
          }
        }
      }
    },
    {
      "id": "1590",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user150@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:39.000+01:00",
        "last_seen_at": "2019-01-19T22:13:39.312+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": "2217"
          }
        }
      }
    },
    {
      "id": "2218",
      "type": "companies",
      "attributes": {
        "name": "Client111",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:39.256+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2217",
      "type": "companies",
      "attributes": {
        "name": "Organization83",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:39.218+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-01-19",
      "ended_on": "2019-01-19",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2019-01-19T22:13:39.498+01:00",
      "updated_at": "2019-01-19T22:13:39.498+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "9"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1593"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1592"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1592"
        }
      }
    }
  },
  "included": [
    {
      "id": "9",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 721
          }
        }
      }
    },
    {
      "id": "1593",
      "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-01-19T22:13:39.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2220"
          }
        }
      }
    },
    {
      "id": "1592",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user152@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:39.000+01:00",
        "last_seen_at": "2019-01-19T22:13:39.515+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": "2219"
          }
        }
      }
    },
    {
      "id": "2220",
      "type": "companies",
      "attributes": {
        "name": "Client112",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:39.476+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2219",
      "type": "companies",
      "attributes": {
        "name": "Organization84",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:39.442+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": "Jan 19, 2019",
      "ended_on": "Jan 19, 2019",
      "time": "360"
    },
    "relationships": {
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1595"
        }
      }
    }
  }
}
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-01-19",
      "ended_on": "2019-01-19",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2019-01-19T22:13:39.716+01:00",
      "updated_at": "2019-01-19T22:13:39.716+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "10"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1595"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1594"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1594"
        }
      }
    }
  },
  "included": [
    {
      "id": "10",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 722
          }
        }
      }
    },
    {
      "id": "1595",
      "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-01-19T22:13:39.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2222"
          }
        }
      }
    },
    {
      "id": "1594",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user154@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:39.000+01:00",
        "last_seen_at": "2019-01-19T22:13:39.694+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": "2221"
          }
        }
      }
    },
    {
      "id": "2222",
      "type": "companies",
      "attributes": {
        "name": "Client113",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:39.661+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2221",
      "type": "companies",
      "attributes": {
        "name": "Organization85",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:39.630+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-01-19",
      "ended_on": "2019-01-19",
      "note": null,
      "total_hours": 0,
      "total_time": 0,
      "created_at": "2019-01-19T22:13:39.985+01:00",
      "updated_at": "2019-01-19T22:13:40.014+01:00"
    },
    "relationships": {
      "service": {
        "data": null
      },
      "event": {
        "data": {
          "type": "events",
          "id": "12"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1599"
        }
      },
      "creator": {
        "data": {
          "type": "people",
          "id": "1598"
        }
      },
      "updater": {
        "data": {
          "type": "people",
          "id": "1598"
        }
      }
    }
  },
  "included": [
    {
      "id": "12",
      "type": "events",
      "attributes": {
        "name": "test name",
        "event_type_id": 2,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 724
          }
        }
      }
    },
    {
      "id": "1599",
      "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-01-19T22:13:39.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2226"
          }
        }
      }
    },
    {
      "id": "1598",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user158@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:39.000+01:00",
        "last_seen_at": "2019-01-19T22:13:39.998+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": "2225"
          }
        }
      }
    },
    {
      "id": "2226",
      "type": "companies",
      "attributes": {
        "name": "Client115",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:39.967+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2225",
      "type": "companies",
      "attributes": {
        "name": "Organization87",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:39.942+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-01-19T22:13:40.344+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1604"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2232"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1604",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user164@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:40.000+01:00",
        "last_seen_at": "2019-01-19T22:13:40.357+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": "2231"
          }
        }
      }
    },
    {
      "id": "2232",
      "type": "companies",
      "attributes": {
        "name": "Client118",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:40.339+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2231",
      "type": "companies",
      "attributes": {
        "name": "Organization90",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:40.324+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-01-19T22:13:40.530+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1605"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": null
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1605",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user165@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:40.000+01:00",
        "last_seen_at": "2019-01-19T22:13:40.521+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": "2233"
          }
        }
      }
    },
    {
      "id": "2233",
      "type": "companies",
      "attributes": {
        "name": "Organization91",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:40.487+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-01-19T22:13:40.710+01:00",
      "pinned_at": null,
      "edited_at": "2019-01-19T22:13:40.749+01:00",
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1607"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2238"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1607",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user167@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:40.000+01:00",
        "last_seen_at": "2019-01-19T22:13:40.728+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": "2237"
          }
        }
      }
    },
    {
      "id": "2238",
      "type": "companies",
      "attributes": {
        "name": "Client121",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:40.704+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2237",
      "type": "companies",
      "attributes": {
        "name": "Organization93",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:40.688+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-01-19T22:13:41.025+01:00",
      "pinned_at": "2019-01-19T22:13:41.048+01:00",
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1609"
        }
      },
      "pinned_by": {
        "data": {
          "type": "people",
          "id": "1609"
        }
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2242"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1609",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user169@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:41.000+01:00",
        "last_seen_at": "2019-01-19T22:13:41.042+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": "2241"
          }
        }
      }
    },
    {
      "id": "2242",
      "type": "companies",
      "attributes": {
        "name": "Client123",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:41.020+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2241",
      "type": "companies",
      "attributes": {
        "name": "Organization95",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:41.003+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-01-19T22:13:41.261+01:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1611"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2246"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1611",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user171@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:41.000+01:00",
        "last_seen_at": "2019-01-19T22:13:41.278+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": "2245"
          }
        }
      }
    },
    {
      "id": "2246",
      "type": "companies",
      "attributes": {
        "name": "Client125",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:41.256+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2245",
      "type": "companies",
      "attributes": {
        "name": "Organization97",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:41.240+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": "2252",
      "type": "companies",
      "attributes": {
        "name": "Client128",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:41.557+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2251",
      "type": "companies",
      "attributes": {
        "name": "Organization100",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:41.542+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/2254

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2254",
    "type": "companies",
    "attributes": {
      "name": "Client129",
      "default_currency": null,
      "created_at": "2019-01-19T22:13:41.650+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": "2257",
    "type": "companies",
    "attributes": {
      "name": "test name",
      "default_currency": null,
      "created_at": "2019-01-19T22:13:41.758+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/2261

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": "1619"
          },
          {
            "type": "people",
            "id": "1620"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2261",
    "type": "companies",
    "attributes": {
      "name": "new name",
      "default_currency": null,
      "created_at": "2019-01-19T22:13:41.891+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/2265

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2267",
    "type": "companies",
    "attributes": {
      "name": "Client136",
      "default_currency": null,
      "created_at": "2019-01-19T22:13:42.220+01:00",
      "archived_at": "2019-01-19T22:13:42.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/2269/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/2271/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/2273/restore

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2273",
    "type": "companies",
    "attributes": {
      "name": "Client139",
      "default_currency": null,
      "created_at": "2019-01-19T22:13:42.427+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": "143",
      "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": "2275"
          }
        },
        "person": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "subsidiary": {
          "data": null
        },
        "organization": {
          "data": {
            "type": "organizations",
            "id": 747
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "2275",
      "type": "companies",
      "attributes": {
        "name": "Client140",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:42.509+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/144

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "144",
    "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": "2277"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 748
        }
      }
    }
  },
  "included": [
    {
      "id": "2277",
      "type": "companies",
      "attributes": {
        "name": "Client141",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:42.617+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": "2279"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "146",
    "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": "2279"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 749
        }
      }
    }
  },
  "included": [
    {
      "id": "2279",
      "type": "companies",
      "attributes": {
        "name": "Client142",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:42.713+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/155

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": "155",
    "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": "2292"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      },
      "organization": {
        "data": {
          "type": "organizations",
          "id": 755
        }
      }
    }
  },
  "included": [
    {
      "id": "2292",
      "type": "companies",
      "attributes": {
        "name": "Client149",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:43.828+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/156

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

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": "73",
      "type": "contracts",
      "attributes": {
        "ends_on": null,
        "next_occurrence_on": "2017-02-01",
        "interval_id": 1
      },
      "relationships": {
        "template": {
          "data": {
            "type": "deals",
            "id": "215"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "215",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-01-19",
        "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": "cf9afd46b5545847f2e9716ec8531219",
        "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-01-19T22:13:44.332+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": "1641"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2303"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1642"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "129"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1641",
      "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": "2302"
          }
        }
      }
    },
    {
      "id": "2303",
      "type": "companies",
      "attributes": {
        "name": "Client155",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:44.293+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1642",
      "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-01-19T22:13:44.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2304"
          }
        }
      }
    },
    {
      "id": "129",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 760
          }
        }
      }
    },
    {
      "id": "2302",
      "type": "companies",
      "attributes": {
        "name": "Organization123",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:44.264+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2304",
      "type": "companies",
      "attributes": {
        "name": "Client156",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:44.306+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/74

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "74",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "216"
        }
      }
    }
  },
  "included": [
    {
      "id": "216",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-01-19",
        "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": "bb3958d4d0441f29e8f9a1551637600c",
        "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-01-19T22:13:44.586+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": "1643"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2306"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1644"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "130"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1643",
      "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": "2305"
          }
        }
      }
    },
    {
      "id": "2306",
      "type": "companies",
      "attributes": {
        "name": "Client157",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:44.547+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1644",
      "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-01-19T22:13:44.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2307"
          }
        }
      }
    },
    {
      "id": "130",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 761
          }
        }
      }
    },
    {
      "id": "2305",
      "type": "companies",
      "attributes": {
        "name": "Organization124",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:44.525+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2307",
      "type": "companies",
      "attributes": {
        "name": "Client158",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:44.559+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": "218"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "76",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "847"
        }
      }
    }
  },
  "included": [
    {
      "id": "218",
      "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": "3256a3704eccfcf849e47aab045ed070",
        "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": "1645"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2311"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1647"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": {
            "type": "projects",
            "id": "376"
          }
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": {
            "type": "contracts",
            "id": "76"
          }
        }
      }
    },
    {
      "id": "1645",
      "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": "2308"
          }
        }
      }
    },
    {
      "id": "2311",
      "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": "1647",
      "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": "2312"
          }
        }
      }
    },
    {
      "id": "376",
      "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": "2314"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1648"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2308",
      "type": "companies",
      "attributes": {
        "name": "Organization125",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:44.786+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2312",
      "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": "2314",
      "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": "1648",
      "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": "2313"
          }
        }
      }
    },
    {
      "id": "2313",
      "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/80

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": "80",
    "type": "contracts",
    "attributes": {
      "ends_on": "2017-12-31",
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "852"
        }
      }
    }
  },
  "included": [
    {
      "id": "223",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-01-19",
        "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": "e5769f930f8a08c7271c118b968a7317",
        "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-01-19T22:13:45.827+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": "1656"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2327"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1657"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "136"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1656",
      "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": "2326"
          }
        }
      }
    },
    {
      "id": "2327",
      "type": "companies",
      "attributes": {
        "name": "Client173",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:45.790+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1657",
      "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-01-19T22:13:45.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2328"
          }
        }
      }
    },
    {
      "id": "136",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 766
          }
        }
      }
    },
    {
      "id": "2326",
      "type": "companies",
      "attributes": {
        "name": "Organization129",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:45.772+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2328",
      "type": "companies",
      "attributes": {
        "name": "Client174",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:45.802+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/81

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": "1670"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1670",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user230@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:47.000+01:00",
        "last_seen_at": "2019-01-19T22:13:47.019+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": "2350"
          }
        }
      }
    },
    {
      "id": "2350",
      "type": "companies",
      "attributes": {
        "name": "Organization133",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:46.966+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": "1671"
        }
      }
    }
  },
  "included": [
    {
      "id": "1671",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user231@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:47.000+01:00",
        "last_seen_at": "2019-01-19T22:13:47.154+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": "2351"
          }
        }
      }
    },
    {
      "id": "2351",
      "type": "companies",
      "attributes": {
        "name": "Organization135",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:47.103+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": "1673"
        }
      }
    }
  },
  "included": [
    {
      "id": "1673",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user233@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:47.000+01:00",
        "last_seen_at": "2019-01-19T22:13:47.365+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": "2353"
          }
        }
      }
    },
    {
      "id": "2353",
      "type": "companies",
      "attributes": {
        "name": "Organization139",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:47.319+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": "140",
      "type": "deal_statuses",
      "attributes": {
        "name": "test deal status",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 782
          }
        }
      }
    }
  ],
  "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/141

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

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

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

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

PATCH  /api/v2/deal_statuses/146

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

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

DELETE  /api/v2/deal_statuses/148

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 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": "232",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-01-19",
        "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": "29012177b1720e3cacbbe0d3c9c27d35",
        "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-01-19T22:13:48.609+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": "1688"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2371"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1689"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "153"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1688",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user248@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:48.000+01:00",
        "last_seen_at": "2019-01-19T22:13:48.630+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": "2370"
          }
        }
      }
    },
    {
      "id": "2371",
      "type": "companies",
      "attributes": {
        "name": "Client197",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:48.574+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1689",
      "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-01-19T22:13:48.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2372"
          }
        }
      }
    },
    {
      "id": "153",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 792
          }
        }
      }
    },
    {
      "id": "2370",
      "type": "companies",
      "attributes": {
        "name": "Organization155",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:48.558+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2372",
      "type": "companies",
      "attributes": {
        "name": "Client198",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:48.585+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/233

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "233",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-01-19",
      "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": "a69d162546d6f5773013718718c73d19",
      "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-01-19T22:13:48.812+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": "1690"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2374"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1691"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "154"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1690",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user250@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:48.000+01:00",
        "last_seen_at": "2019-01-19T22:13:48.831+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": "2373"
          }
        }
      }
    },
    {
      "id": "2374",
      "type": "companies",
      "attributes": {
        "name": "Client199",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:48.778+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1691",
      "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-01-19T22:13:48.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2375"
          }
        }
      }
    },
    {
      "id": "154",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 793
          }
        }
      }
    },
    {
      "id": "2373",
      "type": "companies",
      "attributes": {
        "name": "Organization156",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:48.760+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2375",
      "type": "companies",
      "attributes": {
        "name": "Client200",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:48.789+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": "Jan 19, 2019",
      "deal_type_id": "2",
      "deal_status_id": "155",
      "sales_status_id": "1",
      "probability": "50",
      "currency": "EUR"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "2377"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1694"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "235",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-01-19",
      "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-01-19T22:13:49.000+01:00",
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "email_key": "90c814f166488c5c494e57cfbdadea28",
      "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-01-19T22:13:49.098+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": "1692"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2377"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1694"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "155"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1692",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user252@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:49.000+01:00",
        "last_seen_at": "2019-01-19T22:13:49.063+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": "2376"
          }
        }
      }
    },
    {
      "id": "2377",
      "type": "companies",
      "attributes": {
        "name": "Client201",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:48.985+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1694",
      "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-01-19T22:13:49.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2379"
          }
        }
      }
    },
    {
      "id": "155",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 794
          }
        }
      }
    },
    {
      "id": "2376",
      "type": "companies",
      "attributes": {
        "name": "Organization157",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:48.964+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2379",
      "type": "companies",
      "attributes": {
        "name": "Client203",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:49.045+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/238

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": "1701"
        }
      },
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "1702"
          },
          {
            "type": "people",
            "id": "1703"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "238",
    "type": "deals",
    "attributes": {
      "name": "new name",
      "date": "2019-01-19",
      "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": "e82b826b2feb21996a3f2c6b6b222d57",
      "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-01-19T22:13:49.643+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": "1699"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2387"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1701"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "158"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1699",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user259@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:49.000+01:00",
        "last_seen_at": "2019-01-19T22:13:49.751+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": "2386"
          }
        }
      }
    },
    {
      "id": "2387",
      "type": "companies",
      "attributes": {
        "name": "Client208",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:49.608+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1701",
      "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-01-19T22:13:49.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2389"
          }
        }
      }
    },
    {
      "id": "158",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 797
          }
        }
      }
    },
    {
      "id": "2386",
      "type": "companies",
      "attributes": {
        "name": "Organization160",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:49.591+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2389",
      "type": "companies",
      "attributes": {
        "name": "Client210",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:49.665+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/239

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

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

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "258",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-01-19",
      "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": "540b205cb017802654a1532c007ce3b3",
      "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-01-19T22:13:53.532+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": "1735"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2444"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1737"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": {
          "type": "projects",
          "id": "385"
        }
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1735",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user295@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:53.000+01:00",
        "last_seen_at": "2019-01-19T22:13:53.558+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": "2441"
          }
        }
      }
    },
    {
      "id": "2444",
      "type": "companies",
      "attributes": {
        "name": "Client254",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.385+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1737",
      "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-01-19T22:13:53.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2445"
          }
        }
      }
    },
    {
      "id": "385",
      "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": "2447"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1738"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2441",
      "type": "companies",
      "attributes": {
        "name": "Organization171",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:53.310+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2445",
      "type": "companies",
      "attributes": {
        "name": "Client255",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.397+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2447",
      "type": "companies",
      "attributes": {
        "name": "Client257",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.431+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1738",
      "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-01-19T22:13:53.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2446"
          }
        }
      }
    },
    {
      "id": "2446",
      "type": "companies",
      "attributes": {
        "name": "Client256",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.417+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/260/close

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "260",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2019-01-19",
      "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": "c8190a78de31ab44705a4b1ffeac4dc2",
      "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-01-19T22:13:54.164+01:00",
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2019-01-19T22:13:54.128+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": "1739"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "2451"
        }
      },
      "document_type": {
        "data": null
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1741"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": {
          "type": "projects",
          "id": "386"
        }
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1739",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user299@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:54.000+01:00",
        "last_seen_at": "2019-01-19T22:13:54.155+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": "2448"
          }
        }
      }
    },
    {
      "id": "2451",
      "type": "companies",
      "attributes": {
        "name": "Client260",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.940+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1741",
      "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-01-19T22:13:53.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2452"
          }
        }
      }
    },
    {
      "id": "386",
      "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": "2454"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1742"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2448",
      "type": "companies",
      "attributes": {
        "name": "Organization172",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:53.844+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2452",
      "type": "companies",
      "attributes": {
        "name": "Client261",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.953+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2454",
      "type": "companies",
      "attributes": {
        "name": "Client263",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.990+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1742",
      "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-01-19T22:13:53.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2453"
          }
        }
      }
    },
    {
      "id": "2453",
      "type": "companies",
      "attributes": {
        "name": "Client262",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:53.978+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": "1432"
        }
      }
    }
  },
  "included": [
    {
      "id": "1432",
      "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": 638,
        "default_organization_slug": "638-organization1",
        "intercom_hash": "595686de252eed8b2422f4e5638e77eb1e6699e8b546782a8a62a5894e4566d0",
        "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": "1433"
        }
      }
    }
  },
  "included": [
    {
      "id": "1433",
      "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": 639,
        "default_organization_slug": "639-organization2",
        "intercom_hash": "0a8ab269132deca5d5fe86adf38537ef7ad38be5750dfb94d1e949273bdb5a3f",
        "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": 810
          }
        }
      }
    }
  ],
  "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": 810
          }
        }
      }
    }
  ],
  "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": 811
        }
      }
    }
  },
  "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": 811
          }
        }
      }
    }
  ]
}

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": 812
        }
      }
    }
  },
  "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": 812
          }
        }
      }
    }
  ]
}

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": 815
        }
      }
    }
  },
  "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": 815
          }
        }
      }
    }
  ]
}

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-01-19T22:13:55.303+01:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1753"
          }
        },
        "deal": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "recipients": {
          "data": []
        },
        "cc_recipients": {
          "data": []
        },
        "attachments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "1753",
      "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-01-19T22:13:55.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2465"
          }
        }
      }
    },
    {
      "id": "2465",
      "type": "companies",
      "attributes": {
        "name": "Client264",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:55.290+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-01-19T22:13:55.597+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1757"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1757",
      "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-01-19T22:13:55.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2469"
          }
        }
      }
    },
    {
      "id": "2469",
      "type": "companies",
      "attributes": {
        "name": "Client266",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:55.585+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": "261"
        }
      }
    }
  }
}
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": 261,
      "dismissed_at": null,
      "created_at": "2019-01-19T22:13:55.721+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1759"
        }
      },
      "deal": {
        "data": {
          "type": "deals",
          "id": "261"
        }
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1759",
      "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-01-19T22:13:55.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2471"
          }
        }
      }
    },
    {
      "id": "261",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-01-19",
        "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": "8601ea422f0d2a0e009dbaf2332e24d5",
        "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-01-19T22:13:55.764+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": "1758"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2472"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1760"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "176"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "2471",
      "type": "companies",
      "attributes": {
        "name": "Client267",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:55.709+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1758",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user318@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:55.000+01:00",
        "last_seen_at": "2019-01-19T22:13:55.787+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": "2470"
          }
        }
      }
    },
    {
      "id": "2472",
      "type": "companies",
      "attributes": {
        "name": "Client268",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:55.726+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1760",
      "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-01-19T22:13:55.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2473"
          }
        }
      }
    },
    {
      "id": "176",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 1,
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 822
          }
        }
      }
    },
    {
      "id": "2470",
      "type": "companies",
      "attributes": {
        "name": "Organization185",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:55.687+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2473",
      "type": "companies",
      "attributes": {
        "name": "Client269",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:55.736+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-01-19T22:13:56.557+01:00",
      "created_at": "2019-01-19T22:13:56.543+01:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1769"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1769",
      "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-01-19T22:13:56.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2483"
          }
        }
      }
    },
    {
      "id": "2483",
      "type": "companies",
      "attributes": {
        "name": "Client275",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:56.531+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

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-01-19",
        "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": "263"
          }
        },
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "88"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "263",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2019-01-19",
        "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": "15c80e6e24fcb693dbc49b3f98285f9e",
        "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-01-19T22:13:57.477+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": "1780"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2495"
          }
        },
        "document_type": {
          "data": null
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1781"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": {
            "type": "projects",
            "id": "387"
          }
        },
        "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": 832
          }
        }
      }
    },
    {
      "id": "1780",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user340@email.com",
        "title": null,
        "joined_at": "2019-01-19T22:13:57.000+01:00",
        "last_seen_at": "2019-01-19T22:13:57.557+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": "2494"
          }
        }
      }
    },
    {
      "id": "2495",
      "type": "companies",
      "attributes": {
        "name": "Client281",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:57.319+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1781",
      "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-01-19T22:13:57.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2496"
          }
        }
      }
    },
    {
      "id": "387",
      "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": "2498"
          }
        },
        "project_manager": {
          "data": {
            "type": "people",
            "id": "1782"
          }
        },
        "last_actor": {
          "data": null
        }
      }
    },
    {
      "id": "2494",
      "type": "companies",
      "attributes": {
        "name": "Organization195",
        "default_currency": "USD",
        "created_at": "2019-01-19T22:13:57.300+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2496",
      "type": "companies",
      "attributes": {
        "name": "Client282",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:57.331+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2498",
      "type": "companies",
      "attributes": {
        "name": "Client284",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:57.368+01:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1782",
      "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-01-19T22:13:57.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "norm": null,
        "virtual": false
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2497"
          }
        }
      }
    },
    {
      "id": "2497",
      "type": "companies",
      "attributes": {
        "name": "Client283",
        "default_currency": null,
        "created_at": "2019-01-19T22:13:57.353+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-01-19",
      "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": "264"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "89"
        }
      },