Companies

  • Create a new company

    POST /api/1/companies.json
    Formats
    json jsonp

    Creates a new company. Requires a valid company object to be posted.

    Errors
    • 401 Unauthorized
    • 422 Invalid Record - if the company fails validation. An error message will be returned, declaring the error.
    Example
    POST /api/1/companies
    {
      "company": {
        "name": "Deckow, Trantow and Weimann"
      }
    }
    200
    {
      "response": {
        "contact_email_address": null,
        "contact_first_name": null,
        "contact_home_phone": null,
        "contact_last_name": null,
        "contact_mobile_phone": null,
        "contact_position": null,
        "contact_salutation": null,
        "fax_phone": null,
        "latitude": null,
        "longitude": null,
        "main_address": null,
        "main_city": null,
        "main_country": null,
        "main_phone": null,
        "main_postcode": null,
        "main_state": null,
        "name": "Deckow, Trantow and Weimann",
        "notes": null,
        "uuid": "c3997a19-d43f-4ea5-aef8-6626a13d5bec",
        "visibility": "private",
        "website": null,
        "user_uuids": [
          "a51dec63-b632-4521-944a-8bba893fa812"
        ]
      }
    }
    Parameters
    • company

      An company JSON object.

      • uuid

        A UUID to identify the company. If null, one will be generated

      • name

        Name of the company

      • visibility

        Sets the visibility of the company. Public companies will be added to all staff; Private companies will only be available to the owner; Custom companies are only available to users in the user_uuids array

      • contact_salutation

        Salutation of the contact at the company

      • contact_first_name

        First name of the contact at the company

      • contact_last_name

        Last name of the contact at the company

      • contact_email_address

        Email address of the contact at the company

      • contact_position

        The position of the contact at the company

      • contact_home_phone

        Home phone number of the contact at the company

      • contact_mobile_phone

        Mobile phone number of the contact at the company

      • website

        Web address of the company

      • main_phone

        Phone number of the company

      • fax_phone

        Fax number of the company

      • main_address

        Street address of the company

      • main_city

        City the company resides in

      • main_state

        State the company resides in

      • main_postcode

        Postcode of the company

      • main_country

        Country the company resides in

      • notes

        Notes associated with the company

      • user_uuids

        Array of User UUIDs that can see the company. Requires visibility to be set to ‘custom’

      • longitude

        Longitude of the company. If blank, we’ll try to guess from the address (Requires all address fields to be complete).

      • latitude

        Latitude of the company. If blank, we’ll try to guess from the address (Requires all address fields to be complete).s