API documentation

Companies

Overview

The Company object represents a company a Contact works (or worked) at.

List all the companies in your account

GET /companies/

Parameters

Name Type Description
limit integer Indicates the page size.
page integer Indicates the page to return.

Response

{
  "data": [
    {
      "id": 1,
      "object": "company",
      "name": "Central Perk",
      "website": "http:\/\/url.com",
      "number_of_employees": 3,
      "account": {
        "id": 1
      },
      "created_at": "2019-01-02T14:44:30Z",
      "updated_at": "2019-01-02T14:47:07Z"
    },
    {
      "id": 3,
      "object": "company",
      "name": "ACME",
      "website": "http:\/\/url.com",
      "number_of_employees": 3,
      "account": {
        "id": 1
      },
      "created_at": "2019-01-02T14:49:07Z",
      "updated_at": "2019-01-02T14:49:07Z"
    }
  ],
  "links": {
    "first": "https:\/\/app.monicahq.com\/api\/companies?page=1",
    "last": "https:\/\/app.monicahq.com\/api\/companies?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https:\/\/app.monicahq.com\/api\/companies",
    "per_page": 15,
    "to": 2,
    "total": 2
  }
}

Get a specific company

GET /companies/:id

Response

{
  "data": {
    "id": 1,
    "object": "company",
    "name": "Central Perk",
    "website": "http:\/\/url.com",
    "number_of_employees": 3,
    "account": {
      "id": 1
    },
    "created_at": "2019-01-02T14:44:30Z",
    "updated_at": "2019-01-02T14:47:07Z"
  }
}

Create a company

POST /companies/

Input

Name Type Description
name string Required. The name of the company. Max 255 characters.
website string The URL of the website of the company. Max 255 characters.
number_of_employees integer The number of employees in the company.

Example

{
    "name": "ACME",
    "website": "http://url.com",
    "number_of_employees": 3
}

Response

The API call returns a Company object if the call succeeds.

{
  "data": {
    "id": 1,
    "object": "company",
    "name": "ACME",
    "website": "http:\/\/url.com",
    "number_of_employees": 3,
    "account": {
      "id": 1
    },
    "created_at": "2019-01-02T14:44:30Z",
    "updated_at": "2019-01-02T14:44:30Z"
  }
}

Update a company

PUT /companies/:id

Input

Name Type Description
name string Required. The name of the company. Max 255 characters.
website string The URL of the website of the company. Max 255 characters.
number_of_employees integer The number of employees in the company.

Example

{
    "name": "Central Perk",
    "website": "http://url.com",
    "number_of_employees": 3
}

Response

{
  "data": {
    "id": 1,
    "object": "company",
    "name": "Central Perk",
    "website": "http:\/\/url.com",
    "number_of_employees": 3,
    "account": {
      "id": 1
    },
    "created_at": "2019-01-02T14:44:30Z",
    "updated_at": "2019-01-02T14:47:07Z"
  }
}

Delete a call

DELETE /companies/:id

Response

The response sends back the id that was just deleted.

{
  "deleted": true,
  "id": 1
}

Company

© 2018 — 2024

Proudly Canadian