Productive V2 API

API Endpoint

This api is implemented according to JSON API spec.


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, use your credentials on the Sessions call.

On successful login, you will get a token for authentication on all other routes on the API v2, by adding the token value to the X-Auth-Token header.


Pagination

Pagination has to be set in the following style:

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

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


Filter

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

  • ?filter[person_id]=24


Activities

Activities

Supported filter params

  • task_id

  • project_id

  • deal_id

  • company_id

  • person_id

  • creator_id

  • pinned

  • root_type

  • after

  • before

GET /api/v2/1/activities
Requestsreturns activities

GET  /api/v2/190/activities?filter[task_id]=60&token=1d104000-fb8f-40ec-a6a2-6d9df51080d4

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1",
      "type": "activities",
      "attributes": {
        "event": "create",
        "changes": "",
        "item_id": 60,
        "item_type": "task",
        "item_name": "#1: Ticket title",
        "item_deleted_at": null,
        "parent_id": 117,
        "parent_type": "project",
        "parent_name": "test project",
        "parent_deleted_at": null,
        "root_id": 117,
        "root_type": "project",
        "root_name": "test project",
        "root_deleted_at": null,
        "deal_is_budget": false,
        "created_at": "2017-10-17T08:55:04.000+02:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1083"
          }
        },
        "comment": {
          "data": null
        },
        "email": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1083",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user72@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:04.000+02:00",
        "last_seen_at": "2017-10-17T08:55:04.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1661"
          }
        }
      }
    },
    {
      "id": "1661",
      "type": "companies",
      "attributes": {
        "name": "Organization57",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:04.000+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/190/activities?filter%5Btask_id%5D=60&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=1d104000-fb8f-40ec-a6a2-6d9df51080d4",
    "last": "http://test.host/api/v2/190/activities?filter%5Btask_id%5D=60&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=1d104000-fb8f-40ec-a6a2-6d9df51080d4"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get activities
GET/api/v2/{company_slug}/activities

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/activities/1
Requestsreturns activity

GET  /api/v2/193/activities/6?token=d7a3c868-59bc-4fd1-b032-20ce159d9840

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "6",
    "type": "activities",
    "attributes": {
      "event": "create",
      "changes": "",
      "item_id": 65,
      "item_type": "task",
      "item_name": "#1: Ticket title",
      "item_deleted_at": null,
      "parent_id": 127,
      "parent_type": "project",
      "parent_name": "test project",
      "parent_deleted_at": null,
      "root_id": 127,
      "root_type": "project",
      "root_name": "test project",
      "root_deleted_at": null,
      "deal_is_budget": false,
      "created_at": "2017-10-17T08:55:08.000+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1108"
        }
      },
      "comment": {
        "data": null
      },
      "email": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1108",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user97@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:08.000+02:00",
        "last_seen_at": "2017-10-17T08:55:08.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1696"
          }
        }
      }
    },
    {
      "id": "1696",
      "type": "companies",
      "attributes": {
        "name": "Organization60",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:07.857+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

activity id

company_slug
number (required) Example: 1

company slug


Attachments

Attachments

GET /api/v2/1/attachments/1
Requestsreturns attachment

GET  /api/v2/194/attachments/1?token=ac6e929f-bf52-4f7f-96bf-57d4c55dd654

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1",
    "type": "attachments",
    "attributes": {
      "attachable_id": 3,
      "name": "img.png",
      "type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/001/original/img.png?1508223308",
      "thumb": "/system/attachments/files/000/000/001/thumb/img.png?1508223308",
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/0520284d2c805d576c67fab00643347d/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0xMC0xN1QxNjo1NTowOVoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "qXlHf4nURy3gqJ/vgvpWvHLLNUY=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1113"
        }
      }
    }
  },
  "included": [
    {
      "id": "1113",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user102@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:09.000+02:00",
        "last_seen_at": "2017-10-17T08:55:09.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1703"
          }
        }
      }
    },
    {
      "id": "1703",
      "type": "companies",
      "attributes": {
        "name": "Organization61",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:08.456+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

attachment id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/attachments
Requestscreates attachmentreturns error

POST  /api/v2/195/attachments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "f4b70a9d-e0c9-44da-97bb-91d8b7e80755",
  "_jsonapi": {
    "data": {
      "type": "attachments",
      "attributes": {
        "name": "img.png",
        "attachable_id": "4",
        "attachable_type": "comment"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "3",
    "type": "attachments",
    "attributes": {
      "attachable_id": 4,
      "name": "img.png",
      "type": null,
      "size": null,
      "url": "/system/attachments/files/000/000/003/original/img.png",
      "thumb": null,
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/5ad73d65a1b7e87d430f59de4d11f0e5/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0xMC0xN1QxNjo1NToxMFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "zNFfRTiZl2wUnF3Ro+LLn9/RvMU=",
        "Content-Type": null
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1114"
        }
      }
    }
  },
  "included": [
    {
      "id": "1114",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user103@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:09.000+02:00",
        "last_seen_at": "2017-10-17T08:55:09.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1705"
          }
        }
      }
    },
    {
      "id": "1705",
      "type": "companies",
      "attributes": {
        "name": "Organization62",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:09.416+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/196/attachments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "64f28f94-e0c9-481d-bcdd-75a41928a522",
  "_jsonapi": {
    "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/{company_slug}/attachments

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/198/attachments/6

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "dad44002-116f-46ad-ae53-be8dbb333957",
  "_jsonapi": {
    "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": "6",
    "type": "attachments",
    "attributes": {
      "attachable_id": 7,
      "name": "img.png",
      "type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/006/original/img.png?1508223311",
      "thumb": "/system/attachments/files/000/000/006/thumb/img.png?1508223311",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/6ab0bc72ff2cb541ebcb4882ff369f90/img.png",
        "AWSAccessKeyId": "AKIAIFEOTRNFHR6QRCQQ",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0xMC0xN1QxNjo1NToxMloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUuZGV2ZWxvcG1lbnQifSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVwbG9hZHMvIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCIiXV19",
        "signature": "kMqZ6mk/0nXJovX5ZU9jbov+ZIg=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1117"
        }
      }
    }
  },
  "included": [
    {
      "id": "1117",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user106@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:12.000+02:00",
        "last_seen_at": "2017-10-17T08:55:12.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1711"
          }
        }
      }
    },
    {
      "id": "1711",
      "type": "companies",
      "attributes": {
        "name": "Organization65",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:11.267+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/199/attachments/7

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7715a4f2-15ad-4a01-bee2-dea4f5121b68",
  "_jsonapi": {
    "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/{company_slug}/attachments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

attachment id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/attachments/1
Requestsdeletes attachment

DELETE  /api/v2/201/attachments/9

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "9f87b509-fa9e-4b51-a803-e8d86122e2ff"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

attachment id

company_slug
number (required) Example: 1

company slug


Billability Reports

Billability Reports

Supported filter params

  • person_id

  • service_type_id

  • tags

  • after

  • before

GET /api/v2/1/billability_reports
Requestsreturns billability reports

GET  /api/v2/202/billability_reports?filter[person_id]=1122&token=8bab7bd4-d999-46d6-b470-31da7433fb8e

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "billability-report-person-1122",
      "type": "billability_reports",
      "attributes": {
        "group": "person",
        "internal_time": 0,
        "client_time": 480
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "1122"
          }
        },
        "service_type": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1122",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user111@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:13.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1720"
          }
        }
      }
    },
    {
      "id": "1720",
      "type": "companies",
      "attributes": {
        "name": "Client68",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:13.867+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/202/billability_reports?filter%5Bperson_id%5D=1122&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=8bab7bd4-d999-46d6-b470-31da7433fb8e",
    "last": "http://test.host/api/v2/202/billability_reports?filter%5Bperson_id%5D=1122&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=8bab7bd4-d999-46d6-b470-31da7433fb8e"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get billability reports
GET/api/v2/{company_slug}/billability_reports

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


Bookings

Bookings

Supported filter params

  • person_id
GET /api/v2/1/bookings
Requestsreturns bookings

GET  /api/v2/203/bookings?token=12b26dac-b340-4f72-84a2-27ecc67bae92

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "209",
      "type": "bookings",
      "attributes": {
        "allocation_type_id": 1,
        "hours": 6,
        "percentage": null,
        "started_on": "2017-10-17",
        "ended_on": "2017-10-17",
        "note": null
      },
      "relationships": {
        "service": {
          "data": {
            "type": "services",
            "id": "342"
          }
        },
        "person": {
          "data": {
            "type": "people",
            "id": "1126"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "342",
      "type": "services",
      "attributes": {
        "name": "test name",
        "deleted_at": null,
        "pricing_type_id": 1,
        "worked_time": 0,
        "unapproved_time": 0,
        "billable_time": 0,
        "estimated_time": null,
        "profit_margin": 100,
        "unit_id": 2,
        "quantity": 1,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "hourly_rate": null,
        "hourly_rate_default": null,
        "hourly_rate_normalized": null,
        "price": 100000,
        "price_default": 125000,
        "price_normalized": 100000,
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "projected_revenue": 50000,
        "projected_revenue_default": 62500,
        "projected_revenue_normalized": 50000,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000
      },
      "relationships": {
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "342"
          }
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "343"
          }
        }
      }
    },
    {
      "id": "1126",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user115@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:15.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1726"
          }
        }
      }
    },
    {
      "id": "342",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 203
          }
        }
      }
    },
    {
      "id": "343",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "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": 100,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:14.923+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 100000,
        "pending_invoicing_default": 125000,
        "pending_invoicing_normalized": 100000,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1124"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1724"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1125"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "696"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1726",
      "type": "companies",
      "attributes": {
        "name": "Client73",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:15.044+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1124",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user113@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:15.000+02:00",
        "last_seen_at": "2017-10-17T08:55:15.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1723"
          }
        }
      }
    },
    {
      "id": "1724",
      "type": "companies",
      "attributes": {
        "name": "Client71",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:14.846+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1125",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user114@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:14.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1725"
          }
        }
      }
    },
    {
      "id": "696",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 203
          }
        }
      }
    },
    {
      "id": "1723",
      "type": "companies",
      "attributes": {
        "name": "Organization70",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:14.632+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1725",
      "type": "companies",
      "attributes": {
        "name": "Client72",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:14.873+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/203/bookings?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=12b26dac-b340-4f72-84a2-27ecc67bae92",
    "last": "http://test.host/api/v2/203/bookings?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=12b26dac-b340-4f72-84a2-27ecc67bae92"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get bookings
GET/api/v2/{company_slug}/bookings

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/bookings/1
Requestsreturns booking

GET  /api/v2/204/bookings/210?token=8893075a-7bdb-4a63-8d8a-4a2d0952094f

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "210",
    "type": "bookings",
    "attributes": {
      "allocation_type_id": 1,
      "hours": 6,
      "percentage": null,
      "started_on": "2017-10-17",
      "ended_on": "2017-10-17",
      "note": null
    },
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "343"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1129"
        }
      }
    }
  },
  "included": [
    {
      "id": "343",
      "type": "services",
      "attributes": {
        "name": "test name",
        "deleted_at": null,
        "pricing_type_id": 1,
        "worked_time": 0,
        "unapproved_time": 0,
        "billable_time": 0,
        "estimated_time": null,
        "profit_margin": 100,
        "unit_id": 2,
        "quantity": 1,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "hourly_rate": null,
        "hourly_rate_default": null,
        "hourly_rate_normalized": null,
        "price": 100000,
        "price_default": 125000,
        "price_normalized": 100000,
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "projected_revenue": 50000,
        "projected_revenue_default": 62500,
        "projected_revenue_normalized": 50000,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000
      },
      "relationships": {
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "343"
          }
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "344"
          }
        }
      }
    },
    {
      "id": "1129",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user118@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:15.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1730"
          }
        }
      }
    },
    {
      "id": "343",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 204
          }
        }
      }
    },
    {
      "id": "344",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "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": 100,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:15.777+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 100000,
        "pending_invoicing_default": 125000,
        "pending_invoicing_normalized": 100000,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1127"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1728"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1128"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "699"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1730",
      "type": "companies",
      "attributes": {
        "name": "Client76",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:15.849+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1127",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user116@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:15.000+02:00",
        "last_seen_at": "2017-10-17T08:55:15.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1727"
          }
        }
      }
    },
    {
      "id": "1728",
      "type": "companies",
      "attributes": {
        "name": "Client74",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:15.725+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1128",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user117@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:15.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1729"
          }
        }
      }
    },
    {
      "id": "699",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 204
          }
        }
      }
    },
    {
      "id": "1727",
      "type": "companies",
      "attributes": {
        "name": "Organization71",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:15.572+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1729",
      "type": "companies",
      "attributes": {
        "name": "Client75",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:15.740+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

booking id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/bookings
Requestscreates the bookingreturns error

POST  /api/v2/205/bookings

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "bbb13b64-71c4-44d8-b3f1-669afb9ac913",
  "_jsonapi": {
    "data": {
      "type": "bookings",
      "attributes": {
        "started_on": "Oct 17, 2017",
        "ended_on": "Oct 17, 2017",
        "allocation_type_id": "1",
        "hours": "6"
      },
      "relationships": {
        "service": {
          "data": {
            "type": "services",
            "id": "344"
          }
        },
        "person": {
          "data": {
            "type": "people",
            "id": "1132"
          }
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "212",
    "type": "bookings",
    "attributes": {
      "allocation_type_id": 1,
      "hours": 6,
      "percentage": null,
      "started_on": "2017-10-17",
      "ended_on": "2017-10-17",
      "note": null
    },
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "344"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1132"
        }
      }
    }
  },
  "included": [
    {
      "id": "344",
      "type": "services",
      "attributes": {
        "name": "test name",
        "deleted_at": null,
        "pricing_type_id": 1,
        "worked_time": 0,
        "unapproved_time": 0,
        "billable_time": 0,
        "estimated_time": null,
        "profit_margin": 100,
        "unit_id": 2,
        "quantity": 1,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "hourly_rate": null,
        "hourly_rate_default": null,
        "hourly_rate_normalized": null,
        "price": 100000,
        "price_default": 125000,
        "price_normalized": 100000,
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "projected_revenue": 50000,
        "projected_revenue_default": 62500,
        "projected_revenue_normalized": 50000,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000
      },
      "relationships": {
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "344"
          }
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "345"
          }
        }
      }
    },
    {
      "id": "1132",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user121@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:16.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1734"
          }
        }
      }
    },
    {
      "id": "344",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 205
          }
        }
      }
    },
    {
      "id": "345",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "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": 100,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:16.571+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 100000,
        "pending_invoicing_default": 125000,
        "pending_invoicing_normalized": 100000,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1130"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1732"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1131"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "702"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1734",
      "type": "companies",
      "attributes": {
        "name": "Client79",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:16.695+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1130",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user119@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:16.000+02:00",
        "last_seen_at": "2017-10-17T08:55:16.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1731"
          }
        }
      }
    },
    {
      "id": "1732",
      "type": "companies",
      "attributes": {
        "name": "Client77",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:16.386+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1131",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user120@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:16.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1733"
          }
        }
      }
    },
    {
      "id": "702",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 205
          }
        }
      }
    },
    {
      "id": "1731",
      "type": "companies",
      "attributes": {
        "name": "Organization72",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:16.203+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1733",
      "type": "companies",
      "attributes": {
        "name": "Client78",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:16.407+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/206/bookings

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "d19b25a3-2f3b-4362-ab00-0c578c8ef1cf",
  "_jsonapi": {
    "data": {
      "type": "bookings",
      "attributes": {
        "allocation_type_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/service"
      }
    },
    {
      "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/percentage"
      }
    }
  ]
}

Create a booking
POST/api/v2/{company_slug}/bookings

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/207/bookings/214

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b0af3534-49ed-4058-8360-13353a75ae7e",
  "_jsonapi": {
    "data": {
      "type": "bookings",
      "attributes": {
        "hours": "2"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "214",
    "type": "bookings",
    "attributes": {
      "allocation_type_id": 1,
      "hours": 2,
      "percentage": null,
      "started_on": "2017-10-17",
      "ended_on": "2017-10-17",
      "note": null
    },
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "346"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "1138"
        }
      }
    }
  },
  "included": [
    {
      "id": "346",
      "type": "services",
      "attributes": {
        "name": "test name",
        "deleted_at": null,
        "pricing_type_id": 1,
        "worked_time": 0,
        "unapproved_time": 0,
        "billable_time": 0,
        "estimated_time": null,
        "profit_margin": 100,
        "unit_id": 2,
        "quantity": 1,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "hourly_rate": null,
        "hourly_rate_default": null,
        "hourly_rate_normalized": null,
        "price": 100000,
        "price_default": 125000,
        "price_normalized": 100000,
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "projected_revenue": 50000,
        "projected_revenue_default": 62500,
        "projected_revenue_normalized": 50000,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000
      },
      "relationships": {
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "346"
          }
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "347"
          }
        }
      }
    },
    {
      "id": "1138",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user127@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:17.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1742"
          }
        }
      }
    },
    {
      "id": "346",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 207
          }
        }
      }
    },
    {
      "id": "347",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "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": 100,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:17.856+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 100000,
        "profit_default": 125000,
        "profit_normalized": 100000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 100000,
        "pending_invoicing_default": 125000,
        "pending_invoicing_normalized": 100000,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1136"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1740"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1137"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "708"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1742",
      "type": "companies",
      "attributes": {
        "name": "Client85",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:17.946+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1136",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user125@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:17.000+02:00",
        "last_seen_at": "2017-10-17T08:55:17.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1739"
          }
        }
      }
    },
    {
      "id": "1740",
      "type": "companies",
      "attributes": {
        "name": "Client83",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:17.758+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1137",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user126@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:17.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1741"
          }
        }
      }
    },
    {
      "id": "708",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 207
          }
        }
      }
    },
    {
      "id": "1739",
      "type": "companies",
      "attributes": {
        "name": "Organization74",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:17.605+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1741",
      "type": "companies",
      "attributes": {
        "name": "Client84",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:17.774+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/208/bookings/215

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

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

URI Parameters
HideShow
id
number (required) Example: 1

booking id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/bookings/1
Requestsdeletes booking

DELETE  /api/v2/209/bookings/216

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "4a575244-5e9d-43c6-9783-83dcbbc038ce"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

booking id

company_slug
number (required) Example: 1

company slug


Comments

Comments

GET /api/v2/1/comments/1
Requestsreturns comment

GET  /api/v2/210/comments/11?token=cc288ec4-743c-4bb6-94f4-9ab0df574a73

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2017-10-17T08:55:19.299+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1145"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1752"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1145",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user134@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:19.000+02:00",
        "last_seen_at": "2017-10-17T08:55:19.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1751"
          }
        }
      }
    },
    {
      "id": "1752",
      "type": "companies",
      "attributes": {
        "name": "Client92",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:19.293+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1751",
      "type": "companies",
      "attributes": {
        "name": "Organization77",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:19.187+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

comment id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/comments
Requestscreates staged commentreturns error

POST  /api/v2/211/comments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "8be2904e-d012-44b3-a17d-e9b8c234bca7",
  "_jsonapi": {
    "data": {
      "type": "comments",
      "attributes": {
        "commentable_type": "task"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "comments",
    "attributes": {
      "commentable_type": "task",
      "body": null,
      "created_at": "2017-10-17T08:55:19.657+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1146"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": null
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1146",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user135@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:19.000+02:00",
        "last_seen_at": "2017-10-17T08:55:19.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1753"
          }
        }
      }
    },
    {
      "id": "1753",
      "type": "companies",
      "attributes": {
        "name": "Organization78",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:19.456+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/212/comments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "85d46495-bcf3-48cf-9aca-e85c85c22f1f",
  "_jsonapi": {
    "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/{company_slug}/comments

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


PATCH /api/v2/1/comments/1
Requestscreates commentreturns error

PATCH  /api/v2/215/comments/18

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "1c1889ea-dfbe-43bf-95cc-374ec04728f7",
  "_jsonapi": {
    "data": {
      "type": "comments",
      "attributes": {
        "body": "new body"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "18",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "new body",
      "created_at": "2017-10-17T08:55:20.568+02:00",
      "pinned_at": null,
      "edited_at": "2017-10-17T08:55:20.620+02:00",
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1150"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1762"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1150",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user139@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:20.000+02:00",
        "last_seen_at": "2017-10-17T08:55:20.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1761"
          }
        }
      }
    },
    {
      "id": "1762",
      "type": "companies",
      "attributes": {
        "name": "Client97",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:20.563+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1761",
      "type": "companies",
      "attributes": {
        "name": "Organization82",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:20.455+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/217/comments/20

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "84ac4767-8519-496b-80cb-221fa079ec60",
  "_jsonapi": {
    "data": {
      "type": "comments",
      "attributes": {
        "body": "new body",
        "commentable_id": "0",
        "commentable_type": "company"
      }
    }
  }
}
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"
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

comment id

company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/218/comments/21/pin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "ff5b8a18-a8e7-40b7-9888-5f6b1b61dbf0"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "21",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2017-10-17T08:55:21.223+02:00",
      "pinned_at": "2017-10-17T08:55:21.258+02:00",
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1153"
        }
      },
      "pinned_by": {
        "data": {
          "type": "people",
          "id": "1153"
        }
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1768"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1153",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user142@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:21.000+02:00",
        "last_seen_at": "2017-10-17T08:55:21.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1767"
          }
        }
      }
    },
    {
      "id": "1768",
      "type": "companies",
      "attributes": {
        "name": "Client100",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:21.217+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1767",
      "type": "companies",
      "attributes": {
        "name": "Organization85",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:21.105+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/219/comments/22/pin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "2f7579be-c740-4631-bb73-1abe57552c23"
}
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/{company_slug}/comments/{id}/pin

URI Parameters
HideShow
id
number (required) Example: 1

comment id

company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/220/comments/23/unpin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "ed0e72ef-a877-4757-b53f-a6c46732e5b0"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "23",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2017-10-17T08:55:21.623+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1155"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1772"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1155",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user144@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:21.000+02:00",
        "last_seen_at": "2017-10-17T08:55:21.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1771"
          }
        }
      }
    },
    {
      "id": "1772",
      "type": "companies",
      "attributes": {
        "name": "Client102",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:21.618+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1771",
      "type": "companies",
      "attributes": {
        "name": "Organization87",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:21.513+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/221/comments/24/unpin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "74a2046c-dcbd-4348-b9cb-a96a8c8c56ad"
}
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/{company_slug}/comments/{id}/unpin

URI Parameters
HideShow
id
number (required) Example: 1

comment id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/comments/1
Requestsarchives comment

DELETE  /api/v2/222/comments/25

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "315a8585-fe8d-4a15-af02-151ef4d8d4ca"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

comment id

company_slug
number (required) Example: 1

company slug


Companies

Companies

Supported filter params

  • status

  • tags

  • query

GET /api/v2/1/companies
Requestsreturns companies

GET  /api/v2/223/companies?token=aab17b3e-3ede-49f2-a940-9c913c24ce4c

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1778",
      "type": "companies",
      "attributes": {
        "name": "Client105",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:22.115+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1777",
      "type": "companies",
      "attributes": {
        "name": "Organization90",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:22.032+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/223/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=aab17b3e-3ede-49f2-a940-9c913c24ce4c",
    "last": "http://test.host/api/v2/223/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=aab17b3e-3ede-49f2-a940-9c913c24ce4c"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 2,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get companies
GET/api/v2/{company_slug}/companies

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/companies/1
Requestsreturns company

GET  /api/v2/224/companies/1780?token=fadc08a8-dba3-4d8f-9615-4d4b4ad2eec4

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1780",
    "type": "companies",
    "attributes": {
      "name": "Client106",
      "default_currency": null,
      "created_at": "2017-10-17T08:55:22.292+02:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

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

URI Parameters
HideShow
id
number (required) Example: 1

company id


POST /api/v2/1/companies
Requestscreates companyreturns error

POST  /api/v2/225/companies

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "8732ddff-ac2c-4202-ab5c-0df63c94fdaa",
  "_jsonapi": {
    "data": {
      "type": "companies",
      "attributes": {
        "name": "test name"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1783",
    "type": "companies",
    "attributes": {
      "name": "test name",
      "default_currency": null,
      "created_at": "2017-10-17T08:55:22.544+02:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

POST  /api/v2/226/companies

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "926aa934-01b8-4072-b178-e23bdc2e3ad7",
  "_jsonapi": {
    "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/{company_slug}/companies

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/227/companies/1787

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "44ec4f6a-f9ad-4b4e-9567-648bb2544aab",
  "_jsonapi": {
    "data": {
      "type": "companies",
      "attributes": {
        "name": "new name",
        "tag_list": [
          "design",
          "IT"
        ]
      },
      "relationships": {
        "subscribers": {
          "data": [
            {
              "type": "people",
              "id": "1163"
            },
            {
              "type": "people",
              "id": "1164"
            }
          ]
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1787",
    "type": "companies",
    "attributes": {
      "name": "new name",
      "default_currency": null,
      "created_at": "2017-10-17T08:55:22.863+02:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": [
        "design",
        "IT"
      ]
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/228/companies/1791

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b995b871-52e6-4534-92d5-b9849598ab8c",
  "_jsonapi": {
    "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/229/companies/1793/archive

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "6476e9ea-6926-49a7-a5c9-40aee28b258c"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1793",
    "type": "companies",
    "attributes": {
      "name": "Client113",
      "default_currency": null,
      "created_at": "2017-10-17T08:55:23.336+02:00",
      "archived_at": "2017-10-17T08:55:23.000+02:00",
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/230/companies/1795/archive

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "a4730599-c509-46cd-8b50-c8d48581142a"
}
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/231/companies/1797/restore

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "89b2489e-4d2f-4c15-98c9-ec5533ca6ea0"
}
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/232/companies/1799/restore

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b092bdad-a269-447f-82db-ac467da18e5a"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1799",
    "type": "companies",
    "attributes": {
      "name": "Client116",
      "default_currency": null,
      "created_at": "2017-10-17T08:55:23.799+02:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

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

URI Parameters
HideShow
id
number (required) Example: 1

company id


Contact Entries

Contact Entries

Supported filter params

  • person_id

  • company_id

GET /api/v2/1/contact_entries
Requestsreturns contact entries

GET  /api/v2/233/contact_entries?token=3d15be5a-d0eb-4710-9067-ca8431ab1bf4

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "14",
      "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": "1801"
          }
        },
        "person": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "subsidiary": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1801",
      "type": "companies",
      "attributes": {
        "name": "Client117",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:23.963+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/233/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=3d15be5a-d0eb-4710-9067-ca8431ab1bf4",
    "last": "http://test.host/api/v2/233/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=3d15be5a-d0eb-4710-9067-ca8431ab1bf4"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get contact entries
GET/api/v2/{company_slug}/contact_entries

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/contact_entries/1
Requestsreturns contact_entry

GET  /api/v2/234/contact_entries/15?token=c8449f8b-deb3-4053-b521-ac392a7583df

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "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": "1803"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1803",
      "type": "companies",
      "attributes": {
        "name": "Client118",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:24.174+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

contact entry id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/contact_entries
Requestscreates contact_entryreturns error

POST  /api/v2/235/contact_entries

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5ad1072d-2fe8-4601-8c33-a348de189948",
  "_jsonapi": {
    "data": {
      "type": "contact_entries",
      "attributes": {
        "contactable_type": "company",
        "type": "email",
        "name": "Work",
        "email": "contact@email.com"
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1805"
          }
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "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": "1805"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1805",
      "type": "companies",
      "attributes": {
        "name": "Client119",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:24.341+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/239/contact_entries

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "c8cc716e-0aef-42f8-8905-73646b2b7a55",
  "_jsonapi": {
    "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/{company_slug}/contact_entries

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/241/contact_entries/26

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "367effb4-047f-4cbb-becd-a7fd97babd86",
  "_jsonapi": {
    "data": {
      "type": "contact_entries",
      "attributes": {
        "name": "new name"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "26",
    "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": "1818"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "subsidiary": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1818",
      "type": "companies",
      "attributes": {
        "name": "Client126",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:26.313+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/242/contact_entries/27

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "2421edaf-a86d-41ef-9677-ecd5e65eb84f",
  "_jsonapi": {
    "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/{company_slug}/contact_entries/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contact entry id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/contact_entries/1
Requestsdeletes contact_entry

DELETE  /api/v2/244/contact_entries/29

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "8d0285cf-ac23-4418-a211-236a4a3eaee6"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

contact entry id

company_slug
number (required) Example: 1

company slug


Contracts

Contracts

GET /api/v2/1/contracts
Requestsreturns contracts

GET  /api/v2/246/contracts?token=51cd1b33-3a59-4835-83e1-497bef6e2263

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "2",
      "type": "contracts",
      "attributes": {
        "ends_on": null,
        "next_occurrence_on": "2017-02-01",
        "interval_id": 1
      },
      "relationships": {
        "template": {
          "data": {
            "type": "deals",
            "id": "351"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "351",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:27.404+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1185"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1829"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1186"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "790"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1185",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user174@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
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1828"
          }
        }
      }
    },
    {
      "id": "1829",
      "type": "companies",
      "attributes": {
        "name": "Client132",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:27.349+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1186",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user175@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:27.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1830"
          }
        }
      }
    },
    {
      "id": "790",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 246
          }
        }
      }
    },
    {
      "id": "1828",
      "type": "companies",
      "attributes": {
        "name": "Organization113",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:27.228+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1830",
      "type": "companies",
      "attributes": {
        "name": "Client133",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:27.364+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/246/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=51cd1b33-3a59-4835-83e1-497bef6e2263",
    "last": "http://test.host/api/v2/246/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=51cd1b33-3a59-4835-83e1-497bef6e2263"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get contracts
GET/api/v2/{company_slug}/contracts

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/contracts/1
Requestsreturns contract

GET  /api/v2/247/contracts/3?token=60f946cd-e050-4be6-a126-cdf23bd01803

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "3",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "352"
        }
      }
    }
  },
  "included": [
    {
      "id": "352",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:27.934+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1187"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1832"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1188"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "793"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1187",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user176@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
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1831"
          }
        }
      }
    },
    {
      "id": "1832",
      "type": "companies",
      "attributes": {
        "name": "Client134",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:27.860+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1188",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user177@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:27.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1833"
          }
        }
      }
    },
    {
      "id": "793",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 247
          }
        }
      }
    },
    {
      "id": "1831",
      "type": "companies",
      "attributes": {
        "name": "Organization114",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:27.733+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1833",
      "type": "companies",
      "attributes": {
        "name": "Client135",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:27.887+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

contract id

company_slug
number (required) Example: 1

company slug


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

POST  /api/v2/248/contracts

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7e3a2983-eee9-4b2c-81df-06df94c36ec4",
  "_jsonapi": {
    "data": {
      "type": "contracts",
      "attributes": {
        "interval_id": "1",
        "next_occurrence_on": "01.02.2017"
      },
      "relationships": {
        "template": {
          "data": {
            "type": "deals",
            "id": "354"
          }
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "354"
        }
      }
    }
  },
  "included": [
    {
      "id": "354",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-01-01",
        "end_date": "2017-01-31",
        "number": 2,
        "suffix": "2017/01",
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1189"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1837"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1191"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": {
            "type": "contracts",
            "id": "5"
          }
        }
      }
    },
    {
      "id": "1189",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user178@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
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1834"
          }
        }
      }
    },
    {
      "id": "1837",
      "type": "companies",
      "attributes": {
        "name": "Client138",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1191",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user180@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
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1838"
          }
        }
      }
    },
    {
      "id": "1834",
      "type": "companies",
      "attributes": {
        "name": "Organization115",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:28.169+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1838",
      "type": "companies",
      "attributes": {
        "name": "Client139",
        "default_currency": null,
        "created_at": "2017-01-01T15:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/249/contracts

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "f538f3b2-9605-4e51-8857-8707c3898df9",
  "_jsonapi": {
    "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/{company_slug}/contracts

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/252/contracts/9

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "d29aaed5-39fb-4b0f-b1ec-afcb76a728fc",
  "_jsonapi": {
    "data": {
      "type": "contracts",
      "attributes": {
        "ends_on": "31.12.2017"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "9",
    "type": "contracts",
    "attributes": {
      "ends_on": "2017-12-31",
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "359"
        }
      }
    }
  },
  "included": [
    {
      "id": "359",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:29.698+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1199"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1851"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1200"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "809"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1199",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user188@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
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1850"
          }
        }
      }
    },
    {
      "id": "1851",
      "type": "companies",
      "attributes": {
        "name": "Client148",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:29.651+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1200",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user189@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:29.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1852"
          }
        }
      }
    },
    {
      "id": "809",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 252
          }
        }
      }
    },
    {
      "id": "1850",
      "type": "companies",
      "attributes": {
        "name": "Organization119",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:29.563+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1852",
      "type": "companies",
      "attributes": {
        "name": "Client149",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:29.667+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/253/contracts/10

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7e711582-ca33-4821-b433-1f68e5021c15",
  "_jsonapi": {
    "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/{company_slug}/contracts/{id}

URI Parameters
HideShow
id
number (required) Example: 1

contract id

company_slug
number (required) Example: 1

company slug


Dashboards

Dashboards

GET /api/v2/1/dashboards
Requestsreturns dashboards

GET  /api/v2/256/dashboards?token=942a8a68-8170-45c3-86b1-6926fb6ac186

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1",
      "type": "dashboards",
      "attributes": {
        "name": "dashboard_name"
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "1210"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1210",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user199@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:31.000+02:00",
        "last_seen_at": "2017-10-17T08:55:31.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1868"
          }
        }
      }
    },
    {
      "id": "1868",
      "type": "companies",
      "attributes": {
        "name": "Organization123",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:30.914+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/256/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=942a8a68-8170-45c3-86b1-6926fb6ac186",
    "last": "http://test.host/api/v2/256/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=942a8a68-8170-45c3-86b1-6926fb6ac186"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get dashboards
GET/api/v2/{company_slug}/dashboards

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


POST /api/v2/1/dashboards
Requestscreates the dashboardreturns error

POST  /api/v2/258/dashboards

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "a212a206-dd76-4b73-9e52-c4fe7fdcd2fd",
  "_jsonapi": {
    "data": {
      "type": "dashboards",
      "attributes": {
        "name": "Test Name"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "3",
    "type": "dashboards",
    "attributes": {
      "name": "Test Name"
    },
    "relationships": {
      "person": {
        "data": {
          "type": "people",
          "id": "1211"
        }
      }
    }
  },
  "included": [
    {
      "id": "1211",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user200@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:31.000+02:00",
        "last_seen_at": "2017-10-17T08:55:31.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1870"
          }
        }
      }
    },
    {
      "id": "1870",
      "type": "companies",
      "attributes": {
        "name": "Organization125",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:31.229+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/260/dashboards

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "49f733d1-0357-4625-ab52-bc44d444b74f",
  "_jsonapi": {
    "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/{company_slug}/dashboards

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/262/dashboards/5

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "973db4ab-4da3-475b-a163-e213b752c620",
  "_jsonapi": {
    "data": {
      "type": "dashboard",
      "attributes": {
        "name": "dashboard rename"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "dashboards",
    "attributes": {
      "name": "dashboard rename"
    },
    "relationships": {
      "person": {
        "data": {
          "type": "people",
          "id": "1213"
        }
      }
    }
  },
  "included": [
    {
      "id": "1213",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user202@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:32.000+02:00",
        "last_seen_at": "2017-10-17T08:55:32.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1874"
          }
        }
      }
    },
    {
      "id": "1874",
      "type": "companies",
      "attributes": {
        "name": "Organization129",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:31.832+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/264/dashboards/6

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "19b5c68d-f577-4cf1-95e2-a6db5a2a4be5",
  "_jsonapi": {
    "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/{company_slug}/dashboards/{id}

URI Parameters
HideShow
id
number (required) Example: 1

dashboard id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/dashboards/1
Requestsdeletes dashboard

DELETE  /api/v2/266/dashboards/7

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7b5ec472-5a8f-4529-be34-4cdb87884b5f"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

dashboard id

company_slug
number (required) Example: 1

company slug


Deal Statuses

Deal Statuses

Supported filter params

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

GET  /api/v2/268/deal_statuses?token=414ef0c0-1812-4f08-82d7-1474c71f1cc6

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "843",
      "type": "deal_statuses",
      "attributes": {
        "name": "Opportunity",
        "position": 1
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 268
          }
        }
      }
    },
    {
      "id": "844",
      "type": "deal_statuses",
      "attributes": {
        "name": "Proposal sent",
        "position": 2
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 268
          }
        }
      }
    },
    {
      "id": "845",
      "type": "deal_statuses",
      "attributes": {
        "name": "test deal status",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 268
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/268/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=414ef0c0-1812-4f08-82d7-1474c71f1cc6",
    "last": "http://test.host/api/v2/268/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=414ef0c0-1812-4f08-82d7-1474c71f1cc6"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get deal statuses
GET/api/v2/{company_slug}/deal_statuses

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

GET  /api/v2/269/deal_statuses/848?token=f521cf0f-a06a-46c7-985c-9652851f4e03

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

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

URI Parameters
HideShow
id
number (required) Example: 1

deal status id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/deal_statuses
Requestscreates deal statusreturns error

POST  /api/v2/270/deal_statuses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "939c3601-7672-4487-ab7b-ad64de292493",
  "_jsonapi": {
    "data": {
      "type": "deal_statuses",
      "attributes": {
        "name": "test name"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "852",
    "type": "deal_statuses",
    "attributes": {
      "name": "test name",
      "position": 4
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 270
        }
      }
    }
  }
}

POST  /api/v2/271/deal_statuses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "efa2611a-4a06-4887-834f-f5b636185b74",
  "_jsonapi": {
    "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/{company_slug}/deal_statuses

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/272/deal_statuses/858

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "c394e88c-9ca9-45c3-a57a-d84a99a9ee4e",
  "_jsonapi": {
    "data": {
      "type": "deal_statuses",
      "attributes": {
        "name": "new name"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "858",
    "type": "deal_statuses",
    "attributes": {
      "name": "new name",
      "position": 3
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 272
        }
      }
    }
  }
}

PATCH  /api/v2/273/deal_statuses/861

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "dfe38a93-4d9d-4afd-be2a-b04fd11bd34c",
  "_jsonapi": {
    "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/{company_slug}/deal_statuses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal status id

company_slug
number (required) Example: 1

company slug


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

DELETE  /api/v2/274/deal_statuses/864

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "08449ea4-cd06-4c59-b14f-c31a5613e63c"
}
Responses204
This response has no content.

DELETE  /api/v2/275/deal_statuses/867

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "af14efb9-4a1f-45c4-828c-aa8ba61510d7"
}
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/{company_slug}/deal_statuses/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal status id

company_slug
number (required) Example: 1

company slug


Deals

Deals

Supported filter params

  • responsible_id

  • company_id

  • status_id

  • sales_status_id

  • stage_id

  • contract_id

  • recurring

  • project_id

  • tags

  • query

GET /api/v2/1/deals
Requestsreturns deals

GET  /api/v2/278/deals?token=90626017-7c3f-453c-814b-59dfcc98a1ad

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "368",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:34.481+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1228"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1895"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1229"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "878"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1228",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user217@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:34.000+02:00",
        "last_seen_at": "2017-10-17T08:55:34.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1894"
          }
        }
      }
    },
    {
      "id": "1895",
      "type": "companies",
      "attributes": {
        "name": "Client166",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.430+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1229",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user218@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:34.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1896"
          }
        }
      }
    },
    {
      "id": "878",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 278
          }
        }
      }
    },
    {
      "id": "1894",
      "type": "companies",
      "attributes": {
        "name": "Organization145",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.351+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1896",
      "type": "companies",
      "attributes": {
        "name": "Client167",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.447+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/278/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=90626017-7c3f-453c-814b-59dfcc98a1ad",
    "last": "http://test.host/api/v2/278/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=90626017-7c3f-453c-814b-59dfcc98a1ad"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get deals
GET/api/v2/{company_slug}/deals

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/deals/1
Requestsreturns deal

GET  /api/v2/279/deals/369?token=a42f3743-66f6-4285-8b96-9750b43ffa4f

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "369",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-10-17",
      "end_date": null,
      "number": 1,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": false,
      "sales_status_id": 1,
      "sales_status_updated_at": null,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2017-10-17T08:55:34.811+02:00",
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1230"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1898"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1231"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "881"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1230",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user219@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:34.000+02:00",
        "last_seen_at": "2017-10-17T08:55:34.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1897"
          }
        }
      }
    },
    {
      "id": "1898",
      "type": "companies",
      "attributes": {
        "name": "Client168",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.764+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1231",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user220@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:34.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1899"
          }
        }
      }
    },
    {
      "id": "881",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 279
          }
        }
      }
    },
    {
      "id": "1897",
      "type": "companies",
      "attributes": {
        "name": "Organization146",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.666+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1899",
      "type": "companies",
      "attributes": {
        "name": "Client169",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.778+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

deal id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/deals
Requestscreates dealreturns error

POST  /api/v2/280/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "1bcc44bf-2e54-4b0f-975e-0b3490fe0e5b",
  "_jsonapi": {
    "data": {
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "Oct 17, 2017",
        "deal_type_id": "2",
        "deal_status_id": "884",
        "sales_status_id": "1",
        "probability": "50",
        "currency": "EUR"
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1901"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1234"
          }
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "371",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-10-17",
      "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": "2017-10-17T08:55:35.000+02:00",
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2017-10-17T08:55:35.293+02:00",
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1232"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1901"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1234"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "884"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1232",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user221@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:35.000+02:00",
        "last_seen_at": "2017-10-17T08:55:35.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1900"
          }
        }
      }
    },
    {
      "id": "1901",
      "type": "companies",
      "attributes": {
        "name": "Client170",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:35.123+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1234",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user223@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2017-10-17T08:55:35.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1903"
          }
        }
      }
    },
    {
      "id": "884",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 280
          }
        }
      }
    },
    {
      "id": "1900",
      "type": "companies",
      "attributes": {
        "name": "Organization147",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:34.974+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1903",
      "type": "companies",
      "attributes": {
        "name": "Client172",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:35.191+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/281/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "63135a12-36ec-4ab6-a1da-0ddf0026790a",
  "_jsonapi": {
    "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": "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/{company_slug}/deals

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/283/deals/374

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "cf532dfb-ccb0-4f05-a511-2f89eabe261c",
  "_jsonapi": {
    "data": {
      "type": "deals",
      "attributes": {
        "name": "new name",
        "tag_list": [
          "invoiced",
          "paid"
        ]
      },
      "relationships": {
        "responsible": {
          "data": {
            "type": "people",
            "id": "1241"
          }
        },
        "subscribers": {
          "data": [
            {
              "type": "people",
              "id": "1242"
            },
            {
              "type": "people",
              "id": "1243"
            }
          ]
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "374",
    "type": "deals",
    "attributes": {
      "name": "new name",
      "date": "2017-10-17",
      "end_date": null,
      "number": 1,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": false,
      "sales_status_id": 1,
      "sales_status_updated_at": null,
      "tag_list": [
        "invoiced",
        "paid"
      ],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2017-10-17T08:55:36.072+02:00",
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1239"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1911"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1241"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "893"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1239",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user228@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:36.000+02:00",
        "last_seen_at": "2017-10-17T08:55:36.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1910"
          }
        }
      }
    },
    {
      "id": "1911",
      "type": "companies",
      "attributes": {
        "name": "Client177",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:36.028+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1241",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user230@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2017-10-17T08:55:36.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1913"
          }
        }
      }
    },
    {
      "id": "893",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 283
          }
        }
      }
    },
    {
      "id": "1910",
      "type": "companies",
      "attributes": {
        "name": "Organization150",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:35.940+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1913",
      "type": "companies",
      "attributes": {
        "name": "Client179",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:36.096+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/284/deals/375

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "a7265ed5-e39e-4b44-8e0c-0c5cc73847e3",
  "_jsonapi": {
    "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/{company_slug}/deals/{id}

URI Parameters
HideShow
id
number (required) Example: 1

deal id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/deals/1
Requestsarchives deal

DELETE  /api/v2/285/deals/376

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e716fe6d-43ad-4da2-9cfd-aa5ed50ca864"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

deal id

company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/293/deals/391/open

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "84f8e3d3-4d56-426d-b076-bcdcda5cdcb3"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "391",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-10-17",
      "end_date": null,
      "number": 2,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": true,
      "sales_status_id": null,
      "sales_status_updated_at": null,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": null,
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2017-10-17T08:55:40.263+02:00",
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1270"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1960"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1272"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1270",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user259@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:40.000+02:00",
        "last_seen_at": "2017-10-17T08:55:40.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1957"
          }
        }
      }
    },
    {
      "id": "1960",
      "type": "companies",
      "attributes": {
        "name": "Client216",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:40.217+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1272",
      "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": 3,
        "invited_at": "2017-10-17T08:55:40.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1961"
          }
        }
      }
    },
    {
      "id": "1957",
      "type": "companies",
      "attributes": {
        "name": "Organization160",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:40.032+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1961",
      "type": "companies",
      "attributes": {
        "name": "Client217",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:40.233+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

deal id

company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/294/deals/393/close

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5704c611-3ac2-404f-9ed4-d46b1a477ceb"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "393",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-10-17",
      "end_date": null,
      "number": 2,
      "suffix": null,
      "time_approval": true,
      "client_access": false,
      "deal_type_id": 2,
      "budget": true,
      "sales_status_id": null,
      "sales_status_updated_at": null,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "discount": null,
      "probability": 50,
      "budget_warning": null,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": "2017-10-17T08:55:40.677+02:00",
      "last_activity_at": null,
      "deleted_at": null,
      "created_at": "2017-10-17T08:55:40.646+02:00",
      "todo_count": 0,
      "todo_due_date": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "revenue": 0,
      "revenue_default": 0,
      "revenue_normalized": 0,
      "discounted": 0,
      "discounted_default": 0,
      "discounted_normalized": 0,
      "cost": 0,
      "cost_default": 0,
      "cost_normalized": 0,
      "profit": 0,
      "profit_default": 0,
      "profit_normalized": 0,
      "invoiced": 0,
      "invoiced_default": 0,
      "invoiced_normalized": 0,
      "pending_invoicing": 0,
      "pending_invoicing_default": 0,
      "pending_invoicing_normalized": 0,
      "paid": 0,
      "paid_default": 0,
      "paid_normalized": 0,
      "expense": 0,
      "expense_default": 0,
      "expense_normalized": 0,
      "expense_paid": 0,
      "expense_paid_default": 0,
      "expense_paid_normalized": 0
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1273"
        }
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1965"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1275"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1273",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user262@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:40.000+02:00",
        "last_seen_at": "2017-10-17T08:55:40.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1962"
          }
        }
      }
    },
    {
      "id": "1965",
      "type": "companies",
      "attributes": {
        "name": "Client220",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:40.608+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1275",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user264@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:40.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1966"
          }
        }
      }
    },
    {
      "id": "1962",
      "type": "companies",
      "attributes": {
        "name": "Organization161",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:40.453+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1966",
      "type": "companies",
      "attributes": {
        "name": "Client221",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:40.620+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

deal id

company_slug
number (required) Example: 1

company slug


Devices

Devices

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

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "134",
  "token": "018abfce-61ef-4a5b-aa59-c30f40fe73b0",
  "_jsonapi": {
    "data": {
      "type": "devices",
      "attributes": {
        "name": "device name",
        "device_type_id": "1",
        "push_token": "push_token1",
        "unique_identifier": "unique_identifier1"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier1",
      "push_token": "push_token1",
      "firebase_token": null
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1131"
        }
      }
    }
  },
  "included": [
    {
      "id": "1131",
      "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": 134,
        "default_organization_slug": "134-organization1",
        "intercom_hash": "89945eaf10506004fa9a23dee0f0ad0ce3cc1cb3cce60f1a7583fed60cf58137",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "135",
  "token": "f815167d-76bc-469a-86c6-8a9c0b4b0d86",
  "_jsonapi": {
    "data": {
      "type": "devices",
      "attributes": {
        "name": "device name",
        "device_type_id": "1",
        "push_token": "push_token2",
        "unique_identifier": "unique_identifier2"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "3",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier2",
      "push_token": "push_token2",
      "firebase_token": null
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1132"
        }
      }
    }
  },
  "included": [
    {
      "id": "1132",
      "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": 135,
        "default_organization_slug": "135-organization2",
        "intercom_hash": "4529c6e41fa405dde8d0fd1eaf9bf761c876218576cff29ecc9f83f29d790df2",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "136",
  "token": "625cdfcf-7154-41aa-af6d-f307751264fb",
  "_jsonapi": {
    "data": {
      "type": "devices",
      "attributes": {
        "name": "device name",
        "device_type_id": "1",
        "push_token": "push_token4",
        "unique_identifier": "unique_identifier3"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier3",
      "push_token": "push_token4",
      "firebase_token": null
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1133"
        }
      }
    }
  },
  "included": [
    {
      "id": "1133",
      "type": "users",
      "attributes": {
        "email": "user3@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 136,
        "default_organization_slug": "136-organization3",
        "intercom_hash": "25143f1949f75dbd2c2130febc12c7ac7a35587a3943aa74d51bc69bf2563165",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "137",
  "token": "e850d337-afc0-4bc9-b23f-aa9d99cac8d4",
  "_jsonapi": {
    "data": {
      "type": "devices",
      "attributes": {
        "name": "device name",
        "device_type_id": "1",
        "push_token": null,
        "firebase_token": "firebasetoken",
        "unique_identifier": "unique_identifier5"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "7",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": null,
      "unique_identifier": "unique_identifier5",
      "push_token": null,
      "firebase_token": "firebasetoken"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "1135"
        }
      }
    }
  },
  "included": [
    {
      "id": "1135",
      "type": "users",
      "attributes": {
        "email": "user5@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 137,
        "default_organization_slug": "137-organization4",
        "intercom_hash": "62e896ee90bfe4b18fafdbef82957d286f45e17f4a23bde3e89db7c321d32828",
        "beta_features": [],
        "invitation_token": null,
        "reset_password_token": null
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "138",
  "token": "13946cc3-5e88-486b-abfc-22c7b2e3fba0",
  "_jsonapi": {
    "data": {
      "type": "devices",
      "attributes": {
        "name": ""
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/unique_identifier"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/push_token"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/firebase_token"
      }
    }
  ]
}

Create a device
POST/api/v2/devices


DELETE /api/v2/devices/1
Requestsdeletes device

DELETE  /api/v2/devices/8

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "139",
  "token": "f01fc352-73dc-414f-8fea-492af44095e4"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

device id


Document Types

Document Types

GET /api/v2/1/document_types
Requestsreturns document_types

GET  /api/v2/295/document_types?token=b86bea66-6e76-4052-a5dd-c2840ea7a8f4

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

Get document_types
GET/api/v2/{company_slug}/document_types

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


Emails

Emails

Supported filter params

  • status

  • creator_id

GET /api/v2/1/emails
Requestsreturns emails

GET  /api/v2/296/emails?token=7df3455a-246a-4926-a82b-14e410d068d6

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1",
      "type": "emails",
      "attributes": {
        "subject": null,
        "body": "Email text body",
        "auto_linked": false,
        "dismissed_at": null,
        "created_at": "2017-10-17T08:55:41.160+02:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1278"
          }
        },
        "deal": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "recipients": {
          "data": []
        },
        "cc_recipients": {
          "data": []
        },
        "attachments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "1278",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user267@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:41.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1969"
          }
        }
      }
    },
    {
      "id": "1969",
      "type": "companies",
      "attributes": {
        "name": "Client222",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:41.146+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/296/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=7df3455a-246a-4926-a82b-14e410d068d6",
    "last": "http://test.host/api/v2/296/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=7df3455a-246a-4926-a82b-14e410d068d6"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get emails
GET/api/v2/{company_slug}/emails

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/emails/1
Requestsreturns email

GET  /api/v2/298/emails/3?token=0c920091-9286-410f-9a9d-fdfc746f1f29

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "3",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": null,
      "created_at": "2017-10-17T08:55:41.721+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1282"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1282",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user271@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:41.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1973"
          }
        }
      }
    },
    {
      "id": "1973",
      "type": "companies",
      "attributes": {
        "name": "Client224",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:41.707+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

email id

company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/299/emails/4/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "306ab12f-2e7e-4c05-ad04-b4de82c7701d",
  "_jsonapi": {
    "data": {
      "type": "emails",
      "relationships": {
        "deal": {
          "data": {
            "type": "deals",
            "id": "394"
          }
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": null,
      "created_at": "2017-10-17T08:55:41.915+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1284"
        }
      },
      "deal": {
        "data": {
          "type": "deals",
          "id": "394"
        }
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1284",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user273@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:41.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1975"
          }
        }
      }
    },
    {
      "id": "394",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:41.967+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 0,
        "cost_default": 0,
        "cost_normalized": 0,
        "profit": 0,
        "profit_default": 0,
        "profit_normalized": 0,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 0,
        "expense_default": 0,
        "expense_normalized": 0,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1283"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1976"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1285"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "941"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1975",
      "type": "companies",
      "attributes": {
        "name": "Client225",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:41.904+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1283",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user272@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:41.000+02:00",
        "last_seen_at": "2017-10-17T08:55:41.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1974"
          }
        }
      }
    },
    {
      "id": "1976",
      "type": "companies",
      "attributes": {
        "name": "Client226",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:41.921+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1285",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user274@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:41.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1977"
          }
        }
      }
    },
    {
      "id": "941",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 299
          }
        }
      }
    },
    {
      "id": "1974",
      "type": "companies",
      "attributes": {
        "name": "Organization166",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:41.812+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1977",
      "type": "companies",
      "attributes": {
        "name": "Client227",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:41.935+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/300/emails/5/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e32d8039-3a4b-41e6-a4e1-d250e8a2e573",
  "_jsonapi": {
    "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/{company_slug}/emails/{id}/attach

URI Parameters
HideShow
id
number (required) Example: 1

email id

company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/303/emails/8/dismiss

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b1705d71-d7ac-458a-8d8d-6018208ac52d"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "8",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": "2017-10-17T08:55:42.932+02:00",
      "created_at": "2017-10-17T08:55:42.920+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1294"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1294",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user283@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:42.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1987"
          }
        }
      }
    },
    {
      "id": "1987",
      "type": "companies",
      "attributes": {
        "name": "Client233",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:42.910+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

email id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/emails/1
Requestsdeletes email

DELETE  /api/v2/306/emails/11

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "2cb92224-2ef4-4a37-b678-94746558eee9"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

email id

company_slug
number (required) Example: 1

company slug


Expenses

Expenses

Supported filter params

  • deal_id
GET /api/v2/1/expenses
Requestsreturns expenses

GET  /api/v2/308/expenses?token=5aeb237e-ba00-4a87-96f9-577b3ed2e680

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "3",
      "type": "expenses",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "pay_on": null,
        "paid_on": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 10000,
        "amount_default": 12500,
        "amount_normalized": 10000,
        "reimbursable_amount": 0,
        "reimbursable_amount_default": 0,
        "reimbursable_amount_normalized": 0,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000
      },
      "relationships": {
        "deal": {
          "data": {
            "type": "deals",
            "id": "396"
          }
        },
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "352"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "396",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:43.699+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 10000,
        "expense_default": 12500,
        "expense_normalized": 10000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1303"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1997"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1304"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "352",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 308
          }
        }
      }
    },
    {
      "id": "1303",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user292@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:43.000+02:00",
        "last_seen_at": "2017-10-17T08:55:43.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1996"
          }
        }
      }
    },
    {
      "id": "1997",
      "type": "companies",
      "attributes": {
        "name": "Client238",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:43.665+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1304",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user293@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:43.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1998"
          }
        }
      }
    },
    {
      "id": "1996",
      "type": "companies",
      "attributes": {
        "name": "Organization175",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:43.587+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1998",
      "type": "companies",
      "attributes": {
        "name": "Client239",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:43.677+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/308/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=5aeb237e-ba00-4a87-96f9-577b3ed2e680",
    "last": "http://test.host/api/v2/308/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=5aeb237e-ba00-4a87-96f9-577b3ed2e680"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get expenses
GET/api/v2/{company_slug}/expenses

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/expenses/1
Requestsreturns expense

GET  /api/v2/309/expenses/4?token=b8e82030-5298-4fae-9c23-86dbd110bd8e

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "date": "2017-10-17",
      "pay_on": null,
      "paid_on": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 12500,
      "amount_normalized": 10000,
      "reimbursable_amount": 0,
      "reimbursable_amount_default": 0,
      "reimbursable_amount_normalized": 0,
      "profit": -10000,
      "profit_default": -12500,
      "profit_normalized": -10000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "397"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "353"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "397",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:44.023+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 10000,
        "expense_default": 12500,
        "expense_normalized": 10000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1305"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2000"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1306"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "353",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 309
          }
        }
      }
    },
    {
      "id": "1305",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user294@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:44.000+02:00",
        "last_seen_at": "2017-10-17T08:55:44.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1999"
          }
        }
      }
    },
    {
      "id": "2000",
      "type": "companies",
      "attributes": {
        "name": "Client240",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:43.988+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1306",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user295@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:44.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2001"
          }
        }
      }
    },
    {
      "id": "1999",
      "type": "companies",
      "attributes": {
        "name": "Organization176",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:43.909+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2001",
      "type": "companies",
      "attributes": {
        "name": "Client241",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:43.999+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

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

URI Parameters
HideShow
id
number (required) Example: 1

expense id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/expenses
Requestscreates expensereturns error

POST  /api/v2/310/expenses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "95335901-45c5-4ae6-b299-3779ed9e4688",
  "_jsonapi": {
    "data": {
      "type": "expenses",
      "attributes": {
        "name": "test name",
        "amount": "10000",
        "currency": "USD",
        "date": "Oct 17, 2017"
      },
      "relationships": {
        "deal": {
          "data": {
            "type": "deals",
            "id": "398"
          }
        },
        "service_type": {
          "data": {
            "type": "service-type",
            "id": "354"
          }
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "6",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "date": "2017-10-17",
      "pay_on": null,
      "paid_on": null,
      "currency": "USD",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 10000,
      "amount_normalized": 8000,
      "reimbursable_amount": 0,
      "reimbursable_amount_default": 0,
      "reimbursable_amount_normalized": 0,
      "profit": -8000,
      "profit_default": -10000,
      "profit_normalized": -8000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "398"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "354"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "398",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:44.321+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 18000,
        "cost_default": 22500,
        "cost_normalized": 18000,
        "profit": -18000,
        "profit_default": -22500,
        "profit_normalized": -18000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 18000,
        "expense_default": 22500,
        "expense_normalized": 18000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1307"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2003"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1308"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "354",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 310
          }
        }
      }
    },
    {
      "id": "1307",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user296@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:44.000+02:00",
        "last_seen_at": "2017-10-17T08:55:44.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2002"
          }
        }
      }
    },
    {
      "id": "2003",
      "type": "companies",
      "attributes": {
        "name": "Client242",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:44.286+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1308",
      "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": "2017-10-17T08:55:44.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2004"
          }
        }
      }
    },
    {
      "id": "2002",
      "type": "companies",
      "attributes": {
        "name": "Organization177",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:44.203+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2004",
      "type": "companies",
      "attributes": {
        "name": "Client243",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:44.298+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/311/expenses

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

Create a expense
POST/api/v2/{company_slug}/expenses

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/314/expenses/10

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "114219b6-63fc-4e4a-a3fc-1533ee8ef503",
  "_jsonapi": {
    "data": {
      "type": "expenses",
      "attributes": {
        "name": "new name"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "10",
    "type": "expenses",
    "attributes": {
      "name": "new name",
      "date": "2017-10-17",
      "pay_on": null,
      "paid_on": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 12500,
      "amount_normalized": 10000,
      "reimbursable_amount": 0,
      "reimbursable_amount_default": 0,
      "reimbursable_amount_normalized": 0,
      "profit": -10000,
      "profit_default": -12500,
      "profit_normalized": -10000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "402"
        }
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "358"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "402",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-10-17",
        "end_date": null,
        "number": 1,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": true,
        "sales_status_id": null,
        "sales_status_updated_at": null,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "discount": null,
        "probability": 50,
        "budget_warning": null,
        "billable_time": 0,
        "estimated_time": 0,
        "worked_time": 0,
        "unapproved_entries_count": 0,
        "lost_comment": null,
        "closed_at": null,
        "last_activity_at": null,
        "deleted_at": null,
        "created_at": "2017-10-17T08:55:45.461+02:00",
        "todo_count": 0,
        "todo_due_date": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 0,
        "revenue_default": 0,
        "revenue_normalized": 0,
        "discounted": 0,
        "discounted_default": 0,
        "discounted_normalized": 0,
        "cost": 10000,
        "cost_default": 12500,
        "cost_normalized": 10000,
        "profit": -10000,
        "profit_default": -12500,
        "profit_normalized": -10000,
        "invoiced": 0,
        "invoiced_default": 0,
        "invoiced_normalized": 0,
        "pending_invoicing": 0,
        "pending_invoicing_default": 0,
        "pending_invoicing_normalized": 0,
        "paid": 0,
        "paid_default": 0,
        "paid_normalized": 0,
        "expense": 10000,
        "expense_default": 12500,
        "expense_normalized": 10000,
        "expense_paid": 0,
        "expense_paid_default": 0,
        "expense_paid_normalized": 0
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1315"
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "2015"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1316"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "358",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 314
          }
        }
      }
    },
    {
      "id": "1315",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user304@email.com",
        "title": null,
        "joined_at": "2017-10-17T08:55:45.000+02:00",
        "last_seen_at": "2017-10-17T08:55:45.000+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2014"
          }
        }
      }
    },
    {
      "id": "2015",
      "type": "companies",
      "attributes": {
        "name": "Client250",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:45.420+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1316",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user305@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-10-17T08:55:45.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "2016"
          }
        }
      }
    },
    {
      "id": "2014",
      "type": "companies",
      "attributes": {
        "name": "Organization181",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:45.344+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "2016",
      "type": "companies",
      "attributes": {
        "name": "Client251",
        "default_currency": null,
        "created_at": "2017-10-17T08:55:45.432+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/315/expenses/11

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

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

URI Parameters
HideShow
id
number (required) Example: 1

expense id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/expenses/1
Requestsdeletes expense

DELETE  /api/v2/317/expenses/13

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "6f96c6b2-4c8f-4f64-bccf-6af8d1def3c1"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

expense id

company_slug
number (required) Example: 1

company slug


Filters

Filters

GET /api/v2/1/filters
Requestsreturns filters

GET  /api/v2/318/filters?token=f4bc650e-8f91-4025-8e19-a1b3d19730ef

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

Get filters
GET/api/v2/{company_slug}/filters

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/filters/1
Requestsreturns filter

GET  /api/v2/319/filters/2?token=1c135105-e4c3-4844-b749-4e49bed4ca4e

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

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

URI Parameters
HideShow
id
number (required) Example: 1

filter id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/filters
Requestscreates filterreturns error

POST  /api/v2/320/filters

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "099f554e-8b55-494f-b310-11cfc1312c0f",
  "_jsonapi": {
    "data": {
      "type": "filters",
      "attributes": {
        "name": "test name",
        "filterable_collection": "projects"
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4-projects",
    "type": "filters",
    "attributes": {
      "name": "test name",
      "filterable_id": null,
      "filterable_type": null,
      "filterable_collection": "projects",
      "original_id": 4,
      "default": false,
      "public": false,
      "params": {}
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 320
        }
      }
    }
  }
}

POST  /api/v2/321/filters

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

Create a filter
POST/api/v2/{company_slug}/filters

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


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

PATCH  /api/v2/324/filters/9

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5e496f80-6feb-4215-a449-9f83cbe22890",
  "_jsonapi": {
    "data": {
      "type": "filters",
      "attributes": {
        "name": "new name"
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "9-projects",
    "type": "filters",
    "attributes": {
      "name": "new name",
      "filterable_id": null,
      "filterable_type": null,
      "filterable_collection": "projects",
      "original_id": 9,
      "default": false,
      "public": false,
      "params": {}
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 324
        }
      }
    }
  }
}

PATCH  /api/v2/325/filters/10

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

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

URI Parameters
HideShow
id
number (required) Example: 1

filter id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/filters/1
Requestsdeletes filter

DELETE  /api/v2/327/filters/12

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "702cc31e-f19d-4af8-a835-f1e330e62d3a"
}
Responses204
This response has no content.

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

URI Parameters
HideShow
id
number (required) Example: 1

filter id

company_slug
number (required) Example: 1

company slug


Holidays

Holidays

GET /api/v2/1/holidays
Requestsreturns holidays

GET  /api/v2/328/holidays?token=85c9c3d7-7e6c-4500-8c50-4f9a81e99b66

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2017-10-17"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 328
          }
        }
      }
    },
    {
      "id": "2",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2017-10-17"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 328
          }
        }
      }
    },
    {
      "id": "3",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2017-10-17"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 328
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://test.host/api/v2/328/holidays?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=85c9c3d7-7e6c-4500-8c50-4f9a81e99b66",
    "last": "http://test.host/api/v2/328/holidays?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=85c9c3d7-7e6c-4500-8c50-4f9a81e99b66"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "page_size":