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/494/activities?filter[task_id]=84&token=18ea86f3-c61d-43e3-a3db-3287c3e5953e

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "9",
      "type": "activities",
      "attributes": {
        "event": "create",
        "changes": "",
        "item_id": 84,
        "item_type": "task",
        "item_name": "#1: Ticket title",
        "item_deleted_at": null,
        "parent_id": 192,
        "parent_type": "project",
        "parent_name": "test project",
        "parent_deleted_at": null,
        "root_id": 192,
        "root_type": "project",
        "root_name": "test project",
        "root_deleted_at": null,
        "deal_is_budget": false,
        "created_at": "2017-05-02T10:00:45.000+02:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1055"
          }
        },
        "comment": {
          "data": null
        },
        "email": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1055",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user67@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:45.000+02:00",
        "last_seen_at": "2017-05-02T10:00: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": "1436"
          }
        }
      }
    },
    {
      "id": "1436",
      "type": "companies",
      "attributes": {
        "name": "Organization53",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:45.163+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/494/activities?filter%5Btask_id%5D=84&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=18ea86f3-c61d-43e3-a3db-3287c3e5953e",
    "first": "http://test.host/api/v2/494/activities?filter%5Btask_id%5D=84&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=18ea86f3-c61d-43e3-a3db-3287c3e5953e",
    "last": "http://test.host/api/v2/494/activities?filter%5Btask_id%5D=84&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=18ea86f3-c61d-43e3-a3db-3287c3e5953e"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/498/activities/16?token=bae5cf9b-c1c9-44c5-b6d8-f056bd3eb2cd

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "16",
    "type": "activities",
    "attributes": {
      "event": "create",
      "changes": "",
      "item_id": 91,
      "item_type": "task",
      "item_name": "#1: Ticket title",
      "item_deleted_at": null,
      "parent_id": 206,
      "parent_type": "project",
      "parent_name": "test project",
      "parent_deleted_at": null,
      "root_id": 206,
      "root_type": "project",
      "root_name": "test project",
      "root_deleted_at": null,
      "deal_is_budget": false,
      "created_at": "2017-05-02T10:00:47.000+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1090"
        }
      },
      "comment": {
        "data": null
      },
      "email": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1090",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user102@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:47.000+02:00",
        "last_seen_at": "2017-05-02T10:00:47.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": "1485"
          }
        }
      }
    },
    {
      "id": "1485",
      "type": "companies",
      "attributes": {
        "name": "Organization57",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:47.681+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "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/499/attachments/11?token=4d47d26d-6d85-4a63-8860-07115c1dc2e3

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "attachments",
    "attributes": {
      "attachable_id": 31,
      "name": "img.png",
      "type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/011/original/img.png?1493712048",
      "thumb": "/system/attachments/files/000/000/011/thumb/img.png?1493712048",
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/fc1ab4a4b610341bf904ad4248396ae6/img.png",
        "AWSAccessKeyId": "AKIAJOENLXMQKU2TPU5A",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0wNS0wMlQxODowMDo0OFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUudGVzdCJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwidXBsb2Fkcy8iXSxbInN0YXJ0cy13aXRoIiwiJENvbnRlbnQtVHlwZSIsIiJdXX0=",
        "signature": "WzfV8osO5xR/Iai6FNwRJhUVMuw=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1095"
        }
      }
    }
  },
  "included": [
    {
      "id": "1095",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user107@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:48.000+02:00",
        "last_seen_at": "2017-05-02T10:00:48.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": "1492"
          }
        }
      }
    },
    {
      "id": "1492",
      "type": "companies",
      "attributes": {
        "name": "Organization58",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:47.970+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "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/500/attachments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "2503a077-6cc3-4d82-a9b4-65b734e02f28",
  "data": {
    "type": "attachments",
    "attributes": {
      "name": "img.png",
      "attachable_id": "32",
      "attachable_type": "comment"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "attachments",
    "attributes": {
      "attachable_id": 32,
      "name": "img.png",
      "type": null,
      "size": null,
      "url": "/system/attachments/files/000/000/013/original/img.png",
      "thumb": null,
      "temp_url": null,
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/8a8fb988e2e73387f7d86c63ab0b562a/img.png",
        "AWSAccessKeyId": "AKIAJOENLXMQKU2TPU5A",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0wNS0wMlQxODowMDo0OFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUudGVzdCJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwidXBsb2Fkcy8iXSxbInN0YXJ0cy13aXRoIiwiJENvbnRlbnQtVHlwZSIsIiJdXX0=",
        "signature": "WzfV8osO5xR/Iai6FNwRJhUVMuw=",
        "Content-Type": null
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1100"
        }
      }
    }
  },
  "included": [
    {
      "id": "1100",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user112@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:48.000+02:00",
        "last_seen_at": "2017-05-02T10:00:48.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": "1499"
          }
        }
      }
    },
    {
      "id": "1499",
      "type": "companies",
      "attributes": {
        "name": "Organization59",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:48.424+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/501/attachments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "092ee5a7-fdfa-4a29-a359-67e4e8c52f1e",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "meta": {
        "bulk_index": null
      },
      "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/503/attachments/16

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "ad18b83a-556f-4616-9523-cff9c1a4d7ea",
  "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": "16",
    "type": "attachments",
    "attributes": {
      "attachable_id": 35,
      "name": "img.png",
      "type": "image/png",
      "size": 3479,
      "url": "/system/attachments/files/000/000/016/original/img.png?1493712049",
      "thumb": "/system/attachments/files/000/000/016/thumb/img.png?1493712049",
      "temp_url": "https://s3.amazonaws.com/infinum.productive.test/uploads/1418301662608/dummyfile.pdf",
      "processed": false,
      "attachable_type": "comment",
      "aws_policy": {
        "key": "uploads/8ad8488cce12203d5d5dba1180dd1196/img.png",
        "AWSAccessKeyId": "AKIAJOENLXMQKU2TPU5A",
        "acl": "public-read",
        "success_action_status": "201",
        "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0wNS0wMlQxODowMDo1MFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJpbmZpbnVtLnByb2R1Y3RpdmUudGVzdCJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6IjIwMSJ9LFsic3RhcnRzLXdpdGgiLCIka2V5IiwidXBsb2Fkcy8iXSxbInN0YXJ0cy13aXRoIiwiJENvbnRlbnQtVHlwZSIsIiJdXX0=",
        "signature": "sXRQuebXbnLUKrQQFsJbxh1x0VE=",
        "Content-Type": "image/png"
      }
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1115"
        }
      }
    }
  },
  "included": [
    {
      "id": "1115",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user127@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:49.000+02:00",
        "last_seen_at": "2017-05-02T10:00:49.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": "1520"
          }
        }
      }
    },
    {
      "id": "1520",
      "type": "companies",
      "attributes": {
        "name": "Organization62",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:49.687+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/504/attachments/17

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "20dab879-aa42-45e1-bdc0-c4418620bd4f",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/attachable_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "meta": {
        "bulk_index": null
      },
      "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/506/attachments/19

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b1c5c032-7fdc-4f20-9e23-81e68b4cae55"
}
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/507/billability_reports?filter[person_id]=1136&token=9d31eccc-b314-46f9-a7a5-f9cddff06a06

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "billability-report-person-1136",
      "type": "billability_reports",
      "attributes": {
        "group": "person",
        "internal_time": 0,
        "client_time": 480
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "1136"
          }
        },
        "service_type": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1136",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user148@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:00:51.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1549"
          }
        }
      }
    },
    {
      "id": "1549",
      "type": "companies",
      "attributes": {
        "name": "Client113",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:51.543+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/507/billability_reports?filter%5Bperson_id%5D=1136&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=9d31eccc-b314-46f9-a7a5-f9cddff06a06",
    "first": "http://test.host/api/v2/507/billability_reports?filter%5Bperson_id%5D=1136&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=9d31eccc-b314-46f9-a7a5-f9cddff06a06",
    "last": "http://test.host/api/v2/507/billability_reports?filter%5Bperson_id%5D=1136&page%5Bnumber%5D=1&page%5Bsize%5D=30&token=9d31eccc-b314-46f9-a7a5-f9cddff06a06"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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


Comments

Comments

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

GET  /api/v2/508/comments/39?token=4ccaecc0-18d0-4856-aa68-7cef76aa9402

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "39",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2017-05-02T10:00:52.103+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1138"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1553"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1138",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user150@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:52.000+02:00",
        "last_seen_at": "2017-05-02T10:00:52.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": "1552"
          }
        }
      }
    },
    {
      "id": "1553",
      "type": "companies",
      "attributes": {
        "name": "Client116",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:52.098+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1552",
      "type": "companies",
      "attributes": {
        "name": "Organization67",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:51.993+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "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/509/comments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5ad75958-eb85-41a4-aaf6-083353b0c7cd",
  "data": {
    "type": "comments",
    "attributes": {
      "commentable_type": "task"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "41",
    "type": "comments",
    "attributes": {
      "commentable_type": "task",
      "body": null,
      "created_at": "2017-05-02T10:00:52.355+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1139"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": null
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1139",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user151@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:52.000+02:00",
        "last_seen_at": "2017-05-02T10:00:52.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": "1554"
          }
        }
      }
    },
    {
      "id": "1554",
      "type": "companies",
      "attributes": {
        "name": "Organization68",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:52.231+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/510/comments

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "c2b58a83-d9fa-440f-a345-3b4b5e753457",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/513/comments/46

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "8e8d8e78-fa42-40cb-85cd-2e12f270dafc",
  "data": {
    "type": "comments",
    "attributes": {
      "body": "new body"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "46",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "new body",
      "created_at": "2017-05-02T10:00:53.204+02:00",
      "pinned_at": null,
      "edited_at": "2017-05-02T10:00:53.256+02:00",
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1143"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1563"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1143",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user155@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:53.000+02:00",
        "last_seen_at": "2017-05-02T10:00:53.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": "1562"
          }
        }
      }
    },
    {
      "id": "1563",
      "type": "companies",
      "attributes": {
        "name": "Client121",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:53.200+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1562",
      "type": "companies",
      "attributes": {
        "name": "Organization72",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:53.087+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/516/comments/49

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "fb102c4a-b6c9-4024-a1a6-fbd4dd727d1f",
  "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/517/comments/50/pin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "c74c7258-26eb-4089-b83b-e37dcdd2fce5"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "50",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2017-05-02T10:00:54.050+02:00",
      "pinned_at": "2017-05-02T10:00:54.067+02:00",
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1147"
        }
      },
      "pinned_by": {
        "data": {
          "type": "people",
          "id": "1147"
        }
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1571"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1147",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user159@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:54.000+02:00",
        "last_seen_at": "2017-05-02T10:00:54.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": "1570"
          }
        }
      }
    },
    {
      "id": "1571",
      "type": "companies",
      "attributes": {
        "name": "Client125",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:54.045+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1570",
      "type": "companies",
      "attributes": {
        "name": "Organization76",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:53.977+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/518/comments/51/pin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "751329c4-22f9-444e-a24f-34522f8eda19"
}
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/519/comments/52/unpin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "aba01cd0-397a-4084-a144-e4e1f9ffe90e"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "52",
    "type": "comments",
    "attributes": {
      "commentable_type": "company",
      "body": "blah",
      "created_at": "2017-05-02T10:00:54.386+02:00",
      "pinned_at": null,
      "edited_at": null,
      "deleted_at": null
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1149"
        }
      },
      "pinned_by": {
        "data": null
      },
      "person": {
        "data": null
      },
      "company": {
        "data": {
          "type": "companies",
          "id": "1575"
        }
      },
      "deal": {
        "data": null
      },
      "task": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1149",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user161@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:00:54.000+02:00",
        "last_seen_at": "2017-05-02T10:00:54.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": "1574"
          }
        }
      }
    },
    {
      "id": "1575",
      "type": "companies",
      "attributes": {
        "name": "Client127",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:54.381+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1574",
      "type": "companies",
      "attributes": {
        "name": "Organization78",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:54.316+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/520/comments/53/unpin

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b6a845a2-387f-4916-98dc-081cc69473da"
}
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/521/comments/54

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e88bc9e6-bd22-4394-813a-de64b5f41f76"
}
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/522/companies?token=59a17f8e-4b95-431d-87e4-036b84470823

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1581",
      "type": "companies",
      "attributes": {
        "name": "Client130",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:54.813+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1580",
      "type": "companies",
      "attributes": {
        "name": "Organization81",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:54.750+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/522/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=59a17f8e-4b95-431d-87e4-036b84470823",
    "first": "http://test.host/api/v2/522/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=59a17f8e-4b95-431d-87e4-036b84470823",
    "last": "http://test.host/api/v2/522/companies?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=59a17f8e-4b95-431d-87e4-036b84470823"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 2,
    "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/523/companies/1583?token=bdb8815d-13ab-4d2e-b768-ad1f69f85687

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1583",
    "type": "companies",
    "attributes": {
      "name": "Client131",
      "default_currency": null,
      "created_at": "2017-05-02T10:00:54.944+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/524/companies

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "79882295-ed40-493c-a19f-7eda4f183cb0",
  "data": {
    "type": "companies",
    "attributes": {
      "name": "test name"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1586",
    "type": "companies",
    "attributes": {
      "name": "test name",
      "default_currency": null,
      "created_at": "2017-05-02T10:00:55.123+02:00",
      "archived_at": null,
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

POST  /api/v2/525/companies

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b3403fbb-2d74-4ccc-aab0-1f5c60c619e5",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/526/companies/1590

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "3ffa97f3-39b7-478f-ace3-44e9fbb4c3d8",
  "data": {
    "type": "companies",
    "attributes": {
      "name": "new name",
      "tag_list": [
        "design",
        "IT"
      ]
    },
    "relationships": {
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "1157"
          },
          {
            "type": "people",
            "id": "1158"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1590",
    "type": "companies",
    "attributes": {
      "name": "new name",
      "default_currency": null,
      "created_at": "2017-05-02T10:00:55.364+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/527/companies/1594

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b9abfb82-6df6-46fe-b916-88cf4537a6de",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/528/companies/1596/archive

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "d94a25de-687b-4f53-86d2-5ff10d4786c3"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1596",
    "type": "companies",
    "attributes": {
      "name": "Client138",
      "default_currency": null,
      "created_at": "2017-05-02T10:00:56.188+02:00",
      "archived_at": "2017-05-02T10:00:56.000+02:00",
      "avatar_url": null,
      "description": null,
      "due_days": null,
      "tag_list": []
    },
    "relationships": {
      "bill_to": {
        "data": null
      }
    }
  }
}

PATCH  /api/v2/529/companies/1598/archive

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "f09a54e1-b61c-48f6-ae42-956635f2bc32"
}
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/530/companies/1600/restore

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "42a29917-9854-4447-bcfa-9b7b0550e87a"
}
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/531/companies/1602/restore

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "34677f49-6b47-4b16-8b6e-35f9d918488d"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1602",
    "type": "companies",
    "attributes": {
      "name": "Client141",
      "default_currency": null,
      "created_at": "2017-05-02T10:00:57.127+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/532/contact_entries?token=01d98444-3493-4f3d-9f51-77c2a4858366

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "45",
      "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": "1604"
          }
        },
        "person": {
          "data": null
        },
        "invoice": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1604",
      "type": "companies",
      "attributes": {
        "name": "Client142",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:57.261+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/532/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=01d98444-3493-4f3d-9f51-77c2a4858366",
    "first": "http://test.host/api/v2/532/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=01d98444-3493-4f3d-9f51-77c2a4858366",
    "last": "http://test.host/api/v2/532/contact_entries?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=01d98444-3493-4f3d-9f51-77c2a4858366"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/533/contact_entries/46?token=f716d417-1d91-42ad-ab3c-f2bcc3fb43a3

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "46",
    "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": "1606"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1606",
      "type": "companies",
      "attributes": {
        "name": "Client143",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:57.415+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/534/contact_entries

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7aa01f45-9be6-4f22-867b-0a99fc902158",
  "data": {
    "type": "contact_entries",
    "attributes": {
      "contactable_type": "company",
      "type": "email",
      "name": "Work",
      "email": "contact@email.com"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1608"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "48",
    "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": "1608"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1608",
      "type": "companies",
      "attributes": {
        "name": "Client144",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:57.588+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/538/contact_entries

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e1cb06bd-5fb1-45b9-a871-816ac88ddf02",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/contactable_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "meta": {
        "bulk_index": null
      },
      "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/540/contact_entries/57

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "d31fdb11-4126-4caa-b5f9-7c2d689806c1",
  "data": {
    "type": "contact_entries",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "57",
    "type": "contact_entries",
    "attributes": {
      "contactable_type": "company",
      "type": "email",
      "name": "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": "1621"
        }
      },
      "person": {
        "data": null
      },
      "invoice": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1621",
      "type": "companies",
      "attributes": {
        "name": "Client151",
        "default_currency": null,
        "created_at": "2017-05-02T10:00:59.248+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/541/contact_entries/58

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e169e7c2-1158-478d-91c0-7c5bc973606f",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/543/contact_entries/60

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "453e1d7c-220f-4ddc-a4d6-f22cbbb7ab9e"
}
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/545/contracts?token=b99e1cc5-13b8-404b-978f-0ac26d55f417

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "12",
      "type": "contracts",
      "attributes": {
        "ends_on": null,
        "next_occurrence_on": "2017-02-01",
        "interval_id": 1
      },
      "relationships": {
        "template": {
          "data": {
            "type": "deals",
            "id": "138"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "138",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1632"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1180"
          }
        },
        "deal_status": {
          "meta": {
            "included": false
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "meta": {
            "included": false
          }
        },
        "contract": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "1632",
      "type": "companies",
      "attributes": {
        "name": "Client157",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:00.144+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1180",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user192@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:00.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1633"
          }
        }
      }
    },
    {
      "id": "1633",
      "type": "companies",
      "attributes": {
        "name": "Client158",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:00.157+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/545/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=b99e1cc5-13b8-404b-978f-0ac26d55f417",
    "first": "http://test.host/api/v2/545/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=b99e1cc5-13b8-404b-978f-0ac26d55f417",
    "last": "http://test.host/api/v2/545/contracts?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=b99e1cc5-13b8-404b-978f-0ac26d55f417"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/546/contracts/13?token=0dbf8a00-b0b5-4db6-a078-026836b8b3df

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "139"
        }
      }
    }
  },
  "included": [
    {
      "id": "139",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1635"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1182"
          }
        },
        "deal_status": {
          "meta": {
            "included": false
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "meta": {
            "included": false
          }
        },
        "contract": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "1635",
      "type": "companies",
      "attributes": {
        "name": "Client159",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:00.441+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1182",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user194@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:00.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1636"
          }
        }
      }
    },
    {
      "id": "1636",
      "type": "companies",
      "attributes": {
        "name": "Client160",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:00.454+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/547/contracts

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "9a9cde82-ab9a-4f3e-9939-5f8f5cf95a4f",
  "data": {
    "type": "contracts",
    "attributes": {
      "interval_id": "1",
      "next_occurrence_on": "01.02.2017"
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "141"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "141"
        }
      }
    }
  },
  "included": [
    {
      "id": "141",
      "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,
        "recurring": true,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1640"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1185"
          }
        },
        "deal_status": {
          "meta": {
            "included": false
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "meta": {
            "included": false
          }
        },
        "contract": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "1640",
      "type": "companies",
      "attributes": {
        "name": "Client163",
        "default_currency": null,
        "created_at": "2017-01-01T00:00:00.000+01:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1185",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user197@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-01-01T00:00:00.000+01:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1641"
          }
        }
      }
    },
    {
      "id": "1641",
      "type": "companies",
      "attributes": {
        "name": "Client164",
        "default_currency": null,
        "created_at": "2017-01-01T00: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/548/contracts

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "d21d110d-fa0a-49be-a109-13c899c1e668",
  "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/551/contracts/19

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b3b20ef4-fbff-4a51-9825-43bdbd5ab1f2",
  "data": {
    "type": "contracts",
    "attributes": {
      "ends_on": "31.12.2017"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "19",
    "type": "contracts",
    "attributes": {
      "ends_on": null,
      "next_occurrence_on": "2017-02-01",
      "interval_id": 1
    },
    "relationships": {
      "template": {
        "data": {
          "type": "deals",
          "id": "775"
        }
      }
    }
  },
  "included": [
    {
      "id": "146",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1654"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1194"
          }
        },
        "deal_status": {
          "meta": {
            "included": false
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "meta": {
            "included": false
          }
        },
        "contract": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "1654",
      "type": "companies",
      "attributes": {
        "name": "Client173",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:02.001+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1194",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user206@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:02.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1655"
          }
        }
      }
    },
    {
      "id": "1655",
      "type": "companies",
      "attributes": {
        "name": "Client174",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:02.013+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/552/contracts/20

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "53a11c1e-2b84-40f1-af94-3e51e799adb4",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/555/dashboards?token=f8fc8d18-7535-4012-a588-030477a40184

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "13",
      "type": "dashboards",
      "attributes": {
        "name": "dashboard_name"
      },
      "relationships": {
        "person": {
          "data": {
            "type": "people",
            "id": "1204"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "1204",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user216@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:01:03.000+02:00",
        "last_seen_at": "2017-05-02T10:01:03.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": "1671"
          }
        }
      }
    },
    {
      "id": "1671",
      "type": "companies",
      "attributes": {
        "name": "Organization114",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:03.143+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/555/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=f8fc8d18-7535-4012-a588-030477a40184",
    "first": "http://test.host/api/v2/555/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=f8fc8d18-7535-4012-a588-030477a40184",
    "last": "http://test.host/api/v2/555/dashboards?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=f8fc8d18-7535-4012-a588-030477a40184"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/557/dashboards

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "747008e2-2552-41fb-af9e-e0ccc451d833",
  "data": {
    "type": "dashboards",
    "attributes": {
      "name": "Test Name"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "15",
    "type": "dashboards",
    "attributes": {
      "name": "Test Name"
    },
    "relationships": {
      "person": {
        "data": {
          "type": "people",
          "id": "1205"
        }
      }
    }
  },
  "included": [
    {
      "id": "1205",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user217@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:01:03.000+02:00",
        "last_seen_at": "2017-05-02T10:01:03.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": "1673"
          }
        }
      }
    },
    {
      "id": "1673",
      "type": "companies",
      "attributes": {
        "name": "Organization116",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:03.369+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/559/dashboards

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5ea26cdf-8979-4f7c-a8b6-95de0c046aa9",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/561/dashboards/17

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e11bee08-f31c-44de-8a12-d1e6e6668ab5",
  "data": {
    "type": "dashboard",
    "attributes": {
      "name": "dashboard rename"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "type": "dashboards",
    "attributes": {
      "name": "dashboard rename"
    },
    "relationships": {
      "person": {
        "data": {
          "type": "people",
          "id": "1207"
        }
      }
    }
  },
  "included": [
    {
      "id": "1207",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user219@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:01:03.000+02:00",
        "last_seen_at": "2017-05-02T10:01:03.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": "1677"
          }
        }
      }
    },
    {
      "id": "1677",
      "type": "companies",
      "attributes": {
        "name": "Organization120",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:03.813+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/563/dashboards/18

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5f355359-94be-4203-976c-37f8d8f4828f",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/565/dashboards/19

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "a00e8371-9f00-430f-b336-3f240a1e3510"
}
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/567/deal_statuses?token=260ffd6a-57d9-4b0f-8f7c-d81baeed67b8

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "1209",
      "type": "deal_statuses",
      "attributes": {
        "name": "Opportunity",
        "position": 1
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 567
          }
        }
      }
    },
    {
      "id": "1210",
      "type": "deal_statuses",
      "attributes": {
        "name": "Proposal sent",
        "position": 2
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 567
          }
        }
      }
    },
    {
      "id": "1211",
      "type": "deal_statuses",
      "attributes": {
        "name": "test deal status",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 567
          }
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/567/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=260ffd6a-57d9-4b0f-8f7c-d81baeed67b8",
    "first": "http://test.host/api/v2/567/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=260ffd6a-57d9-4b0f-8f7c-d81baeed67b8",
    "last": "http://test.host/api/v2/567/deal_statuses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=260ffd6a-57d9-4b0f-8f7c-d81baeed67b8"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "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/568/deal_statuses/1214?token=510fe387-5267-448f-bd8a-7582686ff13c

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

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/569/deal_statuses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "a31b2f90-b604-4193-b104-a2cedda11df5",
  "data": {
    "type": "deal_statuses",
    "attributes": {
      "name": "test name"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1218",
    "type": "deal_statuses",
    "attributes": {
      "name": "test name",
      "position": 4
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 569
        }
      }
    }
  }
}

POST  /api/v2/570/deal_statuses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e47d76a2-4cf8-4d83-8e62-a9e1b1def482",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/571/deal_statuses/1224

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "8c74a7f3-eb62-42b2-badb-e477b4fb60f9",
  "data": {
    "type": "deal_statuses",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1224",
    "type": "deal_statuses",
    "attributes": {
      "name": "new name",
      "position": 3
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 571
        }
      }
    }
  }
}

PATCH  /api/v2/572/deal_statuses/1227

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "8284c8f9-5e9d-48ee-bf64-eb0e12569fd3",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/573/deal_statuses/1230

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "ea196423-15c9-46fb-a4fb-f265a54947ad"
}
Responses204
This response has no content.

DELETE  /api/v2/574/deal_statuses/1233

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5c2e4e65-16d7-44de-86ba-1b1b7bd14fe7"
}
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/577/deals?token=18aab624-d76c-4e08-8b21-b2d0fae98f42

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "155",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1698"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1223"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1244"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "1698",
      "type": "companies",
      "attributes": {
        "name": "Client191",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:05.985+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1223",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user235@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:06.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1699"
          }
        }
      }
    },
    {
      "id": "1244",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 577
          }
        }
      }
    },
    {
      "id": "1699",
      "type": "companies",
      "attributes": {
        "name": "Client192",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:05.997+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/577/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=18aab624-d76c-4e08-8b21-b2d0fae98f42",
    "first": "http://test.host/api/v2/577/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=18aab624-d76c-4e08-8b21-b2d0fae98f42",
    "last": "http://test.host/api/v2/577/deals?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=18aab624-d76c-4e08-8b21-b2d0fae98f42"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/578/deals/156?token=2b2c4899-45f6-4795-a8b6-d1df95571570

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "156",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-05-02",
      "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,
      "recurring": false,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "exchange_rate": 1.25,
      "discount": null,
      "probability": 50,
      "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,
      "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": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1701"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1225"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "1247"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1701",
      "type": "companies",
      "attributes": {
        "name": "Client193",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:06.249+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1225",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user237@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:06.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1702"
          }
        }
      }
    },
    {
      "id": "1247",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 578
          }
        }
      }
    },
    {
      "id": "1702",
      "type": "companies",
      "attributes": {
        "name": "Client194",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:06.265+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/579/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "2f95e5b7-d6b8-4ac4-933d-f43f96b18ace",
  "data": {
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "May  2, 2017",
      "deal_type_id": "2",
      "deal_status_id": "1250",
      "sales_status_id": "1",
      "probability": "50",
      "currency": "EUR"
    },
    "relationships": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1704"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1228"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "158",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-05-02",
      "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-05-02T10:01:06.000+02:00",
      "recurring": false,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "exchange_rate": 1.25,
      "discount": null,
      "probability": 50,
      "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,
      "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": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1704"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1228"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "1250"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1704",
      "type": "companies",
      "attributes": {
        "name": "Client195",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:06.554+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1228",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user240@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2017-05-02T10:01:06.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1706"
          }
        }
      }
    },
    {
      "id": "1250",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 579
          }
        }
      }
    },
    {
      "id": "1706",
      "type": "companies",
      "attributes": {
        "name": "Client197",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:06.673+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/580/deals

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "13e453f3-b581-458b-9694-e17ec78b66e4",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/date"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/responsible"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/company"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/deal_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/probability"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not an valid currency",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/deal_status"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/sales_status"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "meta": {
        "bulk_index": null
      },
      "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/582/deals/161

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e6a052d3-4e31-4a46-bde6-e5869300120b",
  "data": {
    "type": "deals",
    "attributes": {
      "name": "new name",
      "tag_list": [
        "invoiced",
        "paid"
      ]
    },
    "relationships": {
      "responsible": {
        "data": {
          "type": "people",
          "id": "1235"
        }
      },
      "subscribers": {
        "data": [
          {
            "type": "people",
            "id": "1236"
          },
          {
            "type": "people",
            "id": "1237"
          }
        ]
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "161",
    "type": "deals",
    "attributes": {
      "name": "new name",
      "date": "2017-05-02",
      "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,
      "recurring": false,
      "tag_list": [
        "invoiced",
        "paid"
      ],
      "origin_deal_id": null,
      "profit_margin": 0,
      "exchange_rate": 1.25,
      "discount": null,
      "probability": 50,
      "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,
      "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": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1714"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1235"
        }
      },
      "deal_status": {
        "data": {
          "type": "deal_statuses",
          "id": "1259"
        }
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1714",
      "type": "companies",
      "attributes": {
        "name": "Client202",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:07.480+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1235",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user247@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 2,
        "invited_at": "2017-05-02T10:01:07.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1716"
          }
        }
      }
    },
    {
      "id": "1259",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 582
          }
        }
      }
    },
    {
      "id": "1716",
      "type": "companies",
      "attributes": {
        "name": "Client204",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:07.589+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/583/deals/162

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "73874de7-e09a-438c-a0d8-4d7060e85e3d",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/584/deals/163

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "26953a31-ebc2-4f3e-b1b3-c5c943f379bd"
}
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/589/deals/173/open

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7fbcd56e-bb65-4cfb-8faa-9d4f0426f443"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "173",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-05-02",
      "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,
      "recurring": false,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "exchange_rate": 1.25,
      "discount": null,
      "probability": 50,
      "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,
      "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": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1750"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1257"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1750",
      "type": "companies",
      "attributes": {
        "name": "Client231",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:10.269+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1257",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user269@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:10.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1751"
          }
        }
      }
    },
    {
      "id": "1751",
      "type": "companies",
      "attributes": {
        "name": "Client232",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:10.282+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/590/deals/175/close

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "6b28a60b-b624-4863-b455-0aa6e1366aee"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "175",
    "type": "deals",
    "attributes": {
      "name": "test name",
      "date": "2017-05-02",
      "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,
      "recurring": false,
      "tag_list": [],
      "origin_deal_id": null,
      "profit_margin": 0,
      "exchange_rate": 1.25,
      "discount": null,
      "probability": 50,
      "billable_time": 0,
      "estimated_time": 0,
      "worked_time": 0,
      "unapproved_entries_count": 0,
      "lost_comment": null,
      "closed_at": "2017-05-02T10:01:10.724+02:00",
      "last_activity_at": null,
      "deleted_at": 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": {
      "company": {
        "data": {
          "type": "companies",
          "id": "1755"
        }
      },
      "responsible": {
        "data": {
          "type": "people",
          "id": "1260"
        }
      },
      "deal_status": {
        "data": null
      },
      "project": {
        "data": null
      },
      "lost_reason": {
        "data": null
      },
      "contract": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "1755",
      "type": "companies",
      "attributes": {
        "name": "Client235",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:10.634+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1260",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user272@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:10.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1756"
          }
        }
      }
    },
    {
      "id": "1756",
      "type": "companies",
      "attributes": {
        "name": "Client236",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:10.647+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 devicereturns error

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "442",
  "token": "8738cb27-c468-4b5e-9561-c74354fcaffd",
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "push_token": "push_token1",
      "apns_server_id": "1",
      "unique_identifier": "unique_identifier1"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": 1,
      "unique_identifier": "unique_identifier1",
      "push_token": "push_token1"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "993"
        }
      }
    }
  },
  "included": [
    {
      "id": "993",
      "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": 442,
        "default_organization_slug": "442-organization1",
        "intercom_hash": "e20b4168fbc5b6bb6877893619124893da1af1cc7d49f8957f2397437ded6561",
        "beta_features": []
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "443",
  "token": "a408be7d-92fe-4f08-aca6-54b1b3ee8f71",
  "data": {
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": "1",
      "push_token": "push_token2",
      "apns_server_id": "1",
      "unique_identifier": "unique_identifier2"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "7",
    "type": "devices",
    "attributes": {
      "name": "device name",
      "device_type_id": 1,
      "apns_server_id": 1,
      "unique_identifier": "unique_identifier2",
      "push_token": "push_token2"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "994"
        }
      }
    }
  },
  "included": [
    {
      "id": "994",
      "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": 443,
        "default_organization_slug": "443-organization2",
        "intercom_hash": "148de0fdf396879a9b3727f97d6a51a5aeba9feb4994ec26154464d2362348fd",
        "beta_features": []
      }
    }
  ]
}

POST  /api/v2/devices

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "444",
  "token": "ce112899-3dc3-4563-b98a-4266d89f4ce9",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/apns_server"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/device_type"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/push_token"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/unique_identifier"
      }
    }
  ]
}

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": "445",
  "token": "db650cbd-c300-4c0e-a976-a78a92537b92"
}
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/591/document_types?token=3b1bd22e-1161-4d4f-b1eb-89f7b9412552

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "2",
      "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
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 591
          }
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/591/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=3b1bd22e-1161-4d4f-b1eb-89f7b9412552",
    "first": "http://test.host/api/v2/591/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=3b1bd22e-1161-4d4f-b1eb-89f7b9412552",
    "last": "http://test.host/api/v2/591/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=3b1bd22e-1161-4d4f-b1eb-89f7b9412552"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/592/emails?token=61246b72-6819-4d40-aee2-f430c37984e7

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "9",
      "type": "emails",
      "attributes": {
        "subject": null,
        "body": "Email text body",
        "auto_linked": false,
        "dismissed_at": null,
        "created_at": "2017-05-02T10:01:11.113+02:00"
      },
      "relationships": {
        "creator": {
          "data": {
            "type": "people",
            "id": "1263"
          }
        },
        "deal": {
          "data": null
        },
        "invoice": {
          "data": null
        },
        "recipients": {
          "data": []
        },
        "cc_recipients": {
          "data": []
        },
        "attachments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "1263",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user275@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:11.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1759"
          }
        }
      }
    },
    {
      "id": "1759",
      "type": "companies",
      "attributes": {
        "name": "Client237",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:11.101+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/592/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=61246b72-6819-4d40-aee2-f430c37984e7",
    "first": "http://test.host/api/v2/592/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=61246b72-6819-4d40-aee2-f430c37984e7",
    "last": "http://test.host/api/v2/592/emails?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=61246b72-6819-4d40-aee2-f430c37984e7"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/593/emails/10?token=540d6226-5e38-48ba-b565-8240eb3cd431

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "10",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": null,
      "created_at": "2017-05-02T10:01:11.346+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1265"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1265",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user277@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:11.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1761"
          }
        }
      }
    },
    {
      "id": "1761",
      "type": "companies",
      "attributes": {
        "name": "Client238",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:11.335+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/594/emails/11/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "ecb1e1ac-6b0a-4d12-81ba-95822e3b2a37",
  "data": {
    "type": "emails",
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "176"
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": null,
      "created_at": "2017-05-02T10:01:11.521+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1267"
        }
      },
      "deal": {
        "data": {
          "type": "deals",
          "id": "176"
        }
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1267",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user279@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:11.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1763"
          }
        }
      }
    },
    {
      "id": "176",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1764"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1268"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1295"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1763",
      "type": "companies",
      "attributes": {
        "name": "Client239",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:11.507+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1764",
      "type": "companies",
      "attributes": {
        "name": "Client240",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:11.530+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1268",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user280@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:11.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1765"
          }
        }
      }
    },
    {
      "id": "1295",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 594
          }
        }
      }
    },
    {
      "id": "1765",
      "type": "companies",
      "attributes": {
        "name": "Client241",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:11.542+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/595/emails/12/attach

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "7991481a-26c8-4489-8456-6f645702aff0",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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 emailreturns error

PATCH  /api/v2/597/emails/14/dismiss

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "0f0c8790-fad4-4dcc-bf1b-524a89a3d29c"
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "emails",
    "attributes": {
      "subject": null,
      "body": "Email text body",
      "auto_linked": false,
      "dismissed_at": "2017-05-02T10:01:12.249+02:00",
      "created_at": "2017-05-02T10:01:12.236+02:00"
    },
    "relationships": {
      "creator": {
        "data": {
          "type": "people",
          "id": "1274"
        }
      },
      "deal": {
        "data": null
      },
      "invoice": {
        "data": null
      },
      "recipients": {
        "data": []
      },
      "cc_recipients": {
        "data": []
      },
      "attachments": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "1274",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user286@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:12.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1771"
          }
        }
      }
    },
    {
      "id": "1771",
      "type": "companies",
      "attributes": {
        "name": "Client244",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:12.225+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/598/emails/15/dismiss

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b893e3fd-5ff9-4a23-9a84-fd0c085395f4"
}
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"
    }
  ]
}

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/599/emails/16

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "db44bf33-2d8f-4061-b9b7-84b554aae486"
}
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/600/expenses?token=103e1be8-21e2-45b6-a2d5-8109bbd1000f

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "11",
      "type": "expenses",
      "attributes": {
        "name": "test name",
        "pay_on": null,
        "paid_on": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 10000,
        "amount_default": 12500,
        "amount_normalized": 10000
      },
      "relationships": {
        "deal": {
          "data": {
            "type": "deals",
            "id": "177"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "177",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1777"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1280"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1777",
      "type": "companies",
      "attributes": {
        "name": "Client247",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:12.700+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1280",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user292@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:12.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1778"
          }
        }
      }
    },
    {
      "id": "1778",
      "type": "companies",
      "attributes": {
        "name": "Client248",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:12.714+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/600/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=103e1be8-21e2-45b6-a2d5-8109bbd1000f",
    "first": "http://test.host/api/v2/600/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=103e1be8-21e2-45b6-a2d5-8109bbd1000f",
    "last": "http://test.host/api/v2/600/expenses?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=103e1be8-21e2-45b6-a2d5-8109bbd1000f"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "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/601/expenses/12?token=2e2205dd-1e25-43ec-961e-fc374c5d2ce9

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "pay_on": null,
      "paid_on": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 12500,
      "amount_normalized": 10000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "178"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "178",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1780"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1282"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1780",
      "type": "companies",
      "attributes": {
        "name": "Client249",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:13.037+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1282",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user294@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:13.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1781"
          }
        }
      }
    },
    {
      "id": "1781",
      "type": "companies",
      "attributes": {
        "name": "Client250",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:13.050+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/602/expenses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "f2bb5a4a-0e0d-4bc2-bec2-7a83f230bae0",
  "data": {
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "amount": "10000",
      "currency": "USD"
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "179"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "expenses",
    "attributes": {
      "name": "test name",
      "pay_on": null,
      "paid_on": null,
      "currency": "USD",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 10000,
      "amount_normalized": 8000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "179"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "179",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1783"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1284"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1783",
      "type": "companies",
      "attributes": {
        "name": "Client251",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:13.389+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1284",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user296@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:13.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1784"
          }
        }
      }
    },
    {
      "id": "1784",
      "type": "companies",
      "attributes": {
        "name": "Client252",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:13.404+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/603/expenses

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "2c9a4fb3-d2db-4ee0-a5da-2998873faeb8",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/deal"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/amount"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/currency"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is not an valid currency",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/currency"
      }
    }
  ]
}

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/605/expenses/17

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "5e604e3e-d419-433f-a225-6c05fcdc8491",
  "data": {
    "type": "expenses",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "type": "expenses",
    "attributes": {
      "name": "new name",
      "pay_on": null,
      "paid_on": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 10000,
      "amount_default": 12500,
      "amount_normalized": 10000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "182"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "182",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1792"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1290"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1792",
      "type": "companies",
      "attributes": {
        "name": "Client257",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:14.271+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1290",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user302@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:14.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1793"
          }
        }
      }
    },
    {
      "id": "1793",
      "type": "companies",
      "attributes": {
        "name": "Client258",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:14.283+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/606/expenses/18

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "d79504cc-a378-4077-a8f0-52711d59a081",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/608/expenses/20

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "05ee0d06-0597-4464-916d-a0a49f5f877a"
}
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/609/filters?token=d945df93-a8a5-4522-a9d7-f13e9b6a78b6

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "-1-deals",
      "type": "filters",
      "attributes": {
        "name": "All deals",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "deals",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-deals",
      "type": "filters",
      "attributes": {
        "name": "My deals",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "deals",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "responsible_id": "1297"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-tasks",
      "type": "filters",
      "attributes": {
        "name": "My open tasks",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "tasks",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "assignee_id": [
            "1297"
          ]
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-tasks",
      "type": "filters",
      "attributes": {
        "name": "My overdue tasks",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "tasks",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "assignee_id": [
            "1297"
          ],
          "due_date": "2"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-5-projects",
      "type": "filters",
      "attributes": {
        "name": "Active projects",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": -5,
        "default": true,
        "public": true,
        "params": {
          "status": "1"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-projects",
      "type": "filters",
      "attributes": {
        "name": "Client projects",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "project_type": "2"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-4-projects",
      "type": "filters",
      "attributes": {
        "name": "Internal projects",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": -4,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "project_type": "1"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-projects",
      "type": "filters",
      "attributes": {
        "name": "Projects I'm responsible for",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "responsible_id": "1297"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-3-projects",
      "type": "filters",
      "attributes": {
        "name": "Archived projects",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": -3,
        "default": true,
        "public": true,
        "params": {
          "status": "2"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-people",
      "type": "filters",
      "attributes": {
        "name": "Active",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "people",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {
          "status": 1
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-people",
      "type": "filters",
      "attributes": {
        "name": "Employees",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "people",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "status": 1,
          "role_id": [
            1,
            2,
            3,
            7,
            8,
            9
          ]
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-3-people",
      "type": "filters",
      "attributes": {
        "name": "Clients",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "people",
        "original_id": -3,
        "default": true,
        "public": true,
        "params": {
          "status": 1,
          "role_id": [
            4,
            5
          ]
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-4-people",
      "type": "filters",
      "attributes": {
        "name": "Contractors",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "people",
        "original_id": -4,
        "default": true,
        "public": true,
        "params": {
          "status": 1,
          "role_id": [
            6
          ]
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-5-people",
      "type": "filters",
      "attributes": {
        "name": "Deactivated",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "people",
        "original_id": -5,
        "default": true,
        "public": true,
        "params": {
          "status": 2
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-companies",
      "type": "filters",
      "attributes": {
        "name": "Active",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "companies",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {
          "status": 1
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-companies",
      "type": "filters",
      "attributes": {
        "name": "Archived",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "companies",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "status": 2
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-emails",
      "type": "filters",
      "attributes": {
        "name": "All unresolved emails",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "emails",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {
          "status": "1"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-emails",
      "type": "filters",
      "attributes": {
        "name": "My unresolved emails",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "emails",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "creator_id": "1297"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-company_time",
      "type": "filters",
      "attributes": {
        "name": "All people",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "company_time",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-invoices",
      "type": "filters",
      "attributes": {
        "name": "All invoices",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "invoices",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-invoices",
      "type": "filters",
      "attributes": {
        "name": "My invoices",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "invoices",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "responsible_id": "1297"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-1-project",
      "type": "filters",
      "attributes": {
        "name": "Open tasks",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "project",
        "original_id": -1,
        "default": true,
        "public": true,
        "params": {
          "status": "1"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-2-project",
      "type": "filters",
      "attributes": {
        "name": "Closed tasks",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "project",
        "original_id": -2,
        "default": true,
        "public": true,
        "params": {
          "status": "2"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "-3-project",
      "type": "filters",
      "attributes": {
        "name": "My open tasks",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "project",
        "original_id": -3,
        "default": true,
        "public": true,
        "params": {
          "status": "1",
          "assignee_id": [
            "1297"
          ]
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    },
    {
      "id": "13-projects",
      "type": "filters",
      "attributes": {
        "name": "filter test name",
        "filterable_id": null,
        "filterable_type": null,
        "filterable_collection": "projects",
        "original_id": 13,
        "default": false,
        "public": false,
        "params": {
          "name": "person",
          "assignee": "2"
        }
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 609
          }
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/609/filters?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=d945df93-a8a5-4522-a9d7-f13e9b6a78b6",
    "first": "http://test.host/api/v2/609/filters?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=d945df93-a8a5-4522-a9d7-f13e9b6a78b6",
    "last": "http://test.host/api/v2/609/filters?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=d945df93-a8a5-4522-a9d7-f13e9b6a78b6"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 0,
    "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/610/filters/14?token=6670819c-c002-4ecd-bffb-1185dedc7292

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

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/611/filters

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

POST  /api/v2/612/filters

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "81904d2d-a004-4e1b-89ed-7acdf0eebf73",
  "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",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/filterable_collection"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "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/615/filters/21

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

PATCH  /api/v2/616/filters/22

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "1fa54631-ade1-4067-a9d0-3fe24378a895",
  "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",
      "meta": {
        "bulk_index": null
      },
      "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/618/filters/24

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "eebe19a9-8bd9-4f36-afff-7db6c87608cf"
}
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/619/holidays?token=c81f173c-766f-447f-9949-b38ba9ebd541

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "23",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2017-05-02"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 619
          }
        }
      }
    },
    {
      "id": "24",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2017-05-02"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 619
          }
        }
      }
    },
    {
      "id": "25",
      "type": "holidays",
      "attributes": {
        "name": "International Goof Off Day",
        "date": "2017-05-02"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 619
          }
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/619/holidays?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=c81f173c-766f-447f-9949-b38ba9ebd541",
    "first": "http://test.host/api/v2/619/holidays?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=c81f173c-766f-447f-9949-b38ba9ebd541",
    "last": "http://test.host/api/v2/619/holidays?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=c81f173c-766f-447f-9949-b38ba9ebd541"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 3,
    "max_page_size": 200
  }
}

Get all holidays
GET/api/v2/{company_slug}/holidays

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/holidays/1
Requestsreturns holiday

GET  /api/v2/623/holidays/26?token=96952285-92fc-4cc9-93f3-c69dab6a7926

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "26",
    "type": "holidays",
    "attributes": {
      "name": "International Goof Off Day",
      "date": "2017-05-02"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 623
        }
      }
    }
  }
}

Get a holiday
GET/api/v2/{company_slug}/holidays/{id}

URI Parameters
HideShow
id
number (required) Example: 1

holiday id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/holidays
Requestscreates the holidayreturns error

POST  /api/v2/627/holidays

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "bcb7a1ac-833d-411d-b9fc-de6f3c86c04f",
  "data": {
    "type": "holidays",
    "attributes": {
      "name": "Dont Cry over Spilled Milk Day",
      "date": "2017-02-11"
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "32",
    "type": "holidays",
    "attributes": {
      "name": "Dont Cry over Spilled Milk Day",
      "date": "2017-02-11"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 627
        }
      }
    }
  }
}

POST  /api/v2/631/holidays

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "1c7ba52c-1a88-457f-b6c4-24e32d4eda27",
  "data": {
    "type": "holidays",
    "attributes": {}
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/date"
      }
    }
  ]
}

Create a holiday
POST/api/v2/{company_slug}/holidays

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


PATCH /api/v2/1/holidays/1
Requestsupdats holidayreturnes error

PATCH  /api/v2/635/holidays/36

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "653357e8-87b4-4e89-9d72-f581fdb20fa9",
  "data": {
    "type": "holidays",
    "attributes": {
      "name": "Lame Duck Day",
      "date": "2017-02-06"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "36",
    "type": "holidays",
    "attributes": {
      "name": "Lame Duck Day",
      "date": "2017-02-06"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 635
        }
      }
    }
  }
}

PATCH  /api/v2/639/holidays/39

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "f1ca4dbe-c980-42be-8753-3ef4dbafcdd8",
  "data": {
    "type": "holidays",
    "attributes": {
      "name": null
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

Update a holiday
PATCH/api/v2/{company_slug}/holidays/{id}

URI Parameters
HideShow
id
number (required) Example: 1

holiday id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/holidays/1
Requestsdeletes a holiday

DELETE  /api/v2/643/holidays/42

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "b898a292-92e8-4f74-a26c-c5a05afcf1aa"
}
Responses204
This response has no content.

Deletes a holiday
DELETE/api/v2/{company_slug}/holidays/{id}

URI Parameters
HideShow
id
number (required) Example: 1

holiday id

company_slug
number (required) Example: 1

company slug


Invitations

Invitations

GET /api/v2/invitations/1
Requestsreturns invitation_tokenreturns error

GET  /api/v2/invitations/1BSSYBsQexdr23MFYZya?company_slug=467&token=756da4ce-a595-4cb6-8c0c-eb412aff2daf

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1BSSYBsQexdr23MFYZya",
    "type": "invitations",
    "attributes": {
      "email": "user37@email.com",
      "first_name": "was first name",
      "last_name": "test last name",
      "time_zone": null
    }
  }
}

GET  /api/v2/invitations/gibberish?company_slug=468&token=eeb85aa3-a6ce-4b5e-b75c-bccd9cec20ec

Headers
Content-Type: application/vnd.api+json
Responses404
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": 404,
      "title": "Record Not Found",
      "detail": "The requested record was not found"
    }
  ]
}

Gets a invitation
GET/api/v2/invitations/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invitation id


PATCH /api/v2/invitations/1
Requestsaccepts invitationreturns error

PATCH  /api/v2/invitations/1BSSYBsQexdr23MFYZya

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "469",
  "token": "55c26589-2a27-4620-8904-c74260276b19",
  "data": {
    "type": "invitations",
    "attributes": {
      "first_name": "new first name",
      "password": "123456",
      "password_confirmation": "123456"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "1BSSYBsQexdr23MFYZya",
    "type": "invitations",
    "attributes": {
      "email": "user40@email.com",
      "first_name": "new first name",
      "last_name": "test last name",
      "time_zone": null
    }
  }
}

PATCH  /api/v2/invitations/1BSSYBsQexdr23MFYZya

Headers
Content-Type: application/vnd.api+json
Body
{
  "company_slug": "472",
  "token": "e52187b1-48aa-4d8c-9c22-c1d95159f9d8",
  "data": {
    "type": "invitations",
    "attributes": {}
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/password"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "is too short (minimum is 6 characters)",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/password"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/password_confirmation"
      }
    }
  ]
}

Update a invitation
PATCH/api/v2/invitations/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invitation id


Invoices

Invoices

Supported filter params

  • deal_id

  • project_id

  • pending

  • responsible_id

  • company_id

  • recurring

GET /api/v2/1/invoices
Requestsreturns invoices

GET  /api/v2/647/invoices?token=42e2773f-049e-43e0-ac36-ca85d60daa82

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "11",
      "type": "invoices",
      "attributes": {
        "invoice_number": "2016/1",
        "invoiced_on": "2017-05-02",
        "sent_on": null,
        "pay_on": "2017-05-12",
        "paid_on": null,
        "written_off_on": null,
        "deleted_at": null,
        "description": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 0,
        "amount_default": 0,
        "amount_normalized": 0
      },
      "relationships": {
        "deal": {
          "data": {
            "type": "deals",
            "id": "186"
          }
        },
        "attachment": {
          "data": null
        }
      }
    }
  ],
  "included": [
    {
      "id": "186",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1846"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1317"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1846",
      "type": "companies",
      "attributes": {
        "name": "Client269",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:18.698+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1317",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user329@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:18.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1847"
          }
        }
      }
    },
    {
      "id": "1847",
      "type": "companies",
      "attributes": {
        "name": "Client270",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:18.715+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/647/invoices?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=42e2773f-049e-43e0-ac36-ca85d60daa82",
    "first": "http://test.host/api/v2/647/invoices?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=42e2773f-049e-43e0-ac36-ca85d60daa82",
    "last": "http://test.host/api/v2/647/invoices?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=42e2773f-049e-43e0-ac36-ca85d60daa82"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "max_page_size": 200
  }
}

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

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/invoices/1
Requestsreturns invoice

GET  /api/v2/648/invoices/12?token=5fed51c0-ee45-4cb7-ae35-0df383dce00d

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "invoices",
    "attributes": {
      "invoice_number": "2016/1",
      "invoiced_on": "2017-05-02",
      "sent_on": null,
      "pay_on": "2017-05-12",
      "paid_on": null,
      "written_off_on": null,
      "deleted_at": null,
      "description": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 0,
      "amount_default": 0,
      "amount_normalized": 0
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "187"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "187",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1849"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1319"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1849",
      "type": "companies",
      "attributes": {
        "name": "Client271",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:19.027+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1319",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user331@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:19.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1850"
          }
        }
      }
    },
    {
      "id": "1850",
      "type": "companies",
      "attributes": {
        "name": "Client272",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:19.041+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

Gets a invoice
GET/api/v2/{company_slug}/invoices/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invoice id

company_slug
number (required) Example: 1

company slug


POST /api/v2/1/invoices
Requestscreates invoicereturns error

POST  /api/v2/649/invoices

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "070b0a07-42a8-4f31-8008-1c2b66b75a7d",
  "data": {
    "type": "invoices",
    "attributes": {
      "invoice_number": "2016/20",
      "amount": "0",
      "invoiced_on": "May  2, 2017",
      "pay_on": "May 12, 2017"
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "188"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "14",
    "type": "invoices",
    "attributes": {
      "invoice_number": "2016/20",
      "invoiced_on": "2017-05-02",
      "sent_on": null,
      "pay_on": "2017-05-12",
      "paid_on": null,
      "written_off_on": null,
      "deleted_at": null,
      "description": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 0,
      "amount_default": 0,
      "amount_normalized": 0
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "188"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "188",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1852"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1321"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1852",
      "type": "companies",
      "attributes": {
        "name": "Client273",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:19.328+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1321",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user333@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:19.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1853"
          }
        }
      }
    },
    {
      "id": "1853",
      "type": "companies",
      "attributes": {
        "name": "Client274",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:19.342+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

POST  /api/v2/650/invoices

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "e746e882-5b17-49ce-a2c1-dd7b0b2acbd8",
  "data": {
    "type": "invoices",
    "attributes": {
      "invoiced_on": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/deal"
      }
    },
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/invoiced_on"
      }
    }
  ]
}

Create a invoice
POST/api/v2/{company_slug}/invoices

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


PATCH /api/v2/1/invoices/1
Requestsupdates invoicereturns error

PATCH  /api/v2/652/invoices/17

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "046cd698-bfb1-43f0-8bfb-977472a46622",
  "data": {
    "type": "invoices",
    "attributes": {
      "amount": "1000"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "17",
    "type": "invoices",
    "attributes": {
      "invoice_number": "2016/1",
      "invoiced_on": "2017-05-02",
      "sent_on": null,
      "pay_on": "2017-05-12",
      "paid_on": null,
      "written_off_on": null,
      "deleted_at": null,
      "description": null,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "amount": 1000,
      "amount_default": 1250,
      "amount_normalized": 1000
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "191"
        }
      },
      "attachment": {
        "data": null
      }
    }
  },
  "included": [
    {
      "id": "191",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": 1000,
        "invoiced_default": 1250,
        "invoiced_normalized": 1000,
        "pending_invoicing": -1000,
        "pending_invoicing_default": -1250,
        "pending_invoicing_normalized": -1000,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1861"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1327"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1861",
      "type": "companies",
      "attributes": {
        "name": "Client279",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:20.161+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1327",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user339@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:20.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1862"
          }
        }
      }
    },
    {
      "id": "1862",
      "type": "companies",
      "attributes": {
        "name": "Client280",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:20.174+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ]
}

PATCH  /api/v2/653/invoices/18

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "72243653-f55d-495c-afa4-f290102373e6",
  "data": {
    "type": "invoices",
    "attributes": {
      "invoiced_on": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "meta": {
        "bulk_index": null
      },
      "source": {
        "pointer": "data/attributes/invoiced_on"
      }
    }
  ]
}

Update a invoice
PATCH/api/v2/{company_slug}/invoices/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invoice id

company_slug
number (required) Example: 1

company slug


DELETE /api/v2/1/invoices/1
Requestsarchives invoice

DELETE  /api/v2/655/invoices/20

Headers
Content-Type: application/vnd.api+json
Body
{
  "token": "59e129da-e738-459b-982a-2eca81265aed"
}
Responses204
This response has no content.

Deletes a invoice
DELETE/api/v2/{company_slug}/invoices/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invoice id

company_slug
number (required) Example: 1

company slug


Line Items

Line Items

Supported filter params

  • invoice_id
GET /api/v2/1/line_items
Requestsreturns line_items

GET  /api/v2/656/line_items?token=1b6c3905-b8f9-441e-a213-48a95cb1bbad

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "11",
      "type": "line_items",
      "attributes": {
        "unit_id": 2,
        "position": 1,
        "quantity": "3.0",
        "description": "test name",
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "unit_price": 5000,
        "unit_price_default": 6250,
        "unit_price_normalized": 5000,
        "amount": 15000,
        "amount_default": 18750,
        "amount_normalized": 15000
      },
      "relationships": {
        "invoice": {
          "data": {
            "type": "new_invoices",
            "id": "31"
          }
        },
        "service": {
          "data": {
            "type": "services",
            "id": "47"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "31",
      "type": "new_invoices",
      "attributes": {
        "number": "2016/01",
        "invoiced_on": "2017-05-02",
        "sent_on": null,
        "pay_on": "2017-05-12",
        "discount": null,
        "tax1_name": null,
        "tax1_value": null,
        "deleted_at": null,
        "tag_list": [],
        "note": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 15000,
        "amount_default": 18750,
        "amount_normalized": 15000,
        "amount_paid": 0,
        "amount_paid_default": 0,
        "amount_paid_normalized": 0,
        "amount_written_off": 0,
        "amount_written_off_default": 0,
        "amount_written_off_normalized": 0,
        "amount_unpaid": 150,
        "amount_unpaid_default": 187,
        "amount_unpaid_normalized": 150
      },
      "relationships": {
        "bill_to": {
          "data": null
        },
        "bill_from": {
          "data": null
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "195"
          }
        },
        "attachment": {
          "data": null
        },
        "document_type": {
          "data": null
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "1334"
          }
        }
      }
    },
    {
      "id": "47",
      "type": "services",
      "attributes": {
        "name": "test name",
        "deleted_at": null,
        "pricing_type_id": 1,
        "worked_time": 0,
        "billable_time": 0,
        "estimated_time": 0,
        "warning": null,
        "profit_margin": 100,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "hourly_rate": null,
        "hourly_rate_default": null,
        "hourly_rate_normalized": null,
        "price": 100000,
        "price_default": 125000,
        "price_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": "60"
          }
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "196"
          }
        }
      }
    },
    {
      "id": "195",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": 15000,
        "invoiced_default": 18750,
        "invoiced_normalized": 15000,
        "pending_invoicing": -15000,
        "pending_invoicing_default": -18750,
        "pending_invoicing_normalized": -15000,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1873"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1335"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1334",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user346@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:01:21.000+02:00",
        "last_seen_at": "2017-05-02T10:01: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": "1872"
          }
        }
      }
    },
    {
      "id": "60",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "deleted_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 656
          }
        }
      }
    },
    {
      "id": "196",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "end_date": null,
        "number": 2,
        "suffix": null,
        "time_approval": true,
        "client_access": false,
        "deal_type_id": 2,
        "budget": false,
        "sales_status_id": 1,
        "sales_status_updated_at": null,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 100,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1875"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1336"
          }
        },
        "deal_status": {
          "data": {
            "type": "deal_statuses",
            "id": "1420"
          }
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1873",
      "type": "companies",
      "attributes": {
        "name": "Client287",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:21.244+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1335",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user347@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:21.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1874"
          }
        }
      }
    },
    {
      "id": "1872",
      "type": "companies",
      "attributes": {
        "name": "Organization215",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:21.182+02:00",
        "archived_at": null,
        "avatar_url": "/images/missing-client.png",
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1875",
      "type": "companies",
      "attributes": {
        "name": "Client289",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:21.374+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1336",
      "type": "people",
      "attributes": {
        "first_name": "name",
        "last_name": "surname",
        "email": "user348@email.com",
        "title": null,
        "joined_at": null,
        "last_seen_at": null,
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 3,
        "invited_at": "2017-05-02T10:01:21.000+02:00",
        "is_user": true,
        "tag_list": [],
        "avatar_url": null
      },
      "relationships": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1876"
          }
        }
      }
    },
    {
      "id": "1420",
      "type": "deal_statuses",
      "attributes": {
        "name": "prospective",
        "position": 3
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 656
          }
        }
      }
    },
    {
      "id": "1874",
      "type": "companies",
      "attributes": {
        "name": "Client288",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:21.257+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "1876",
      "type": "companies",
      "attributes": {
        "name": "Client290",
        "default_currency": null,
        "created_at": "2017-05-02T10:01:21.388+02:00",
        "archived_at": null,
        "avatar_url": null,
        "description": null,
        "due_days": null,
        "tag_list": []
      },
      "relationships": {
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "self": "http://test.host/api/v2/656/line_items?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=1b6c3905-b8f9-441e-a213-48a95cb1bbad",
    "first": "http://test.host/api/v2/656/line_items?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=1b6c3905-b8f9-441e-a213-48a95cb1bbad",
    "last": "http://test.host/api/v2/656/line_items?page%5Bnumber%5D=1&page%5Bsize%5D=30&token=1b6c3905-b8f9-441e-a213-48a95cb1bbad"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "max_page_size": 200
  }
}

Get line items
GET/api/v2/{company_slug}/line_items

URI Parameters
HideShow
company_slug
number (required) Example: 1

company slug


GET /api/v2/1/line_items/1
Requestsreturns line_item

GET  /api/v2/657/line_items/12?token=d921eac4-3dfb-4fa6-8fbe-855283888e98

Headers
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "line_items",
    "attributes": {
      "unit_id": 2,
      "position": 1,
      "quantity": "3.0",
      "description": "test name",
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "unit_price": 5000,
      "unit_price_default": 6250,
      "unit_price_normalized": 5000,
      "amount": 15000,
      "amount_default": 18750,
      "amount_normalized": 15000
    },
    "relationships": {
      "invoice": {
        "data": {
          "type": "new_invoices",
          "id": "32"
        }
      },
      "service": {
        "data": {
          "type": "services",
          "id": "48"
        }
      }
    }
  },
  "included": [
    {
      "id": "32",
      "type": "new_invoices",
      "attributes": {
        "number": "2016/01",
        "invoiced_on": "2017-05-02",
        "sent_on": null,
        "pay_on": "2017-05-12",
        "discount": null,
        "tax1_name": null,
        "tax1_value": null,
        "deleted_at": null,
        "tag_list": [],
        "note": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 15000,
        "amount_default": 18750,
        "amount_normalized": 15000,
        "amount_paid": 0,
        "amount_paid_default": 0,
        "amount_paid_normalized": 0,
        "amount_written_off": 0,
        "amount_written_off_default": 0,
        "amount_written_off_normalized": 0,
        "amount_unpaid": 150,
        "amount_unpaid_default": 187,
        "amount_unpaid_normalized": 150
      },
      "relationships": {
        "bill_to": {
          "data": null
        },
        "bill_from": {
          "data": null
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "197"
          }
        },
        "attachment": {
          "data": null
        },
        "document_type": {
          "data": null
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "1337"
          }
        }
      }
    },
    {
      "id": "48",
      "type": "services",
      "attributes": {
        "name": "test name",
        "deleted_at": null,
        "pricing_type_id": 1,
        "worked_time": 0,
        "billable_time": 0,
        "estimated_time": 0,
        "warning": null,
        "profit_margin": 100,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "revenue": 100000,
        "revenue_default": 125000,
        "revenue_normalized": 100000,
        "hourly_rate": null,
        "hourly_rate_default": null,
        "hourly_rate_normalized": null,
        "price": 100000,
        "price_default": 125000,
        "price_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": "61"
          }
        },
        "deal": {
          "data": {
            "type": "deals",
            "id": "198"
          }
        }
      }
    },
    {
      "id": "197",
      "type": "deals",
      "attributes": {
        "name": "test name",
        "date": "2017-05-02",
        "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,
        "recurring": false,
        "tag_list": [],
        "origin_deal_id": null,
        "profit_margin": 0,
        "exchange_rate": 1.25,
        "discount": null,
        "probability": 50,
        "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,
        "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": 15000,
        "invoiced_default": 18750,
        "invoiced_normalized": 15000,
        "pending_invoicing": -15000,
        "pending_invoicing_default": -18750,
        "pending_invoicing_normalized": -15000,
        "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": {
        "company": {
          "data": {
            "type": "companies",
            "id": "1878"
          }
        },
        "responsible": {
          "data": {
            "type": "people",
            "id": "1338"
          }
        },
        "deal_status": {
          "data": null
        },
        "project": {
          "data": null
        },
        "lost_reason": {
          "data": null
        },
        "contract": {
          "data": null
        }
      }
    },
    {
      "id": "1337",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user349@email.com",
        "title": null,
        "joined_at": "2017-05-02T10:01:22.000+02:00",
        "last_seen_at": "2017-05-02T10:01:22.000+02:00",
        "deactivated_at": null,
        "