Companies

Creating an company-account

POST /companies

You need a trusted client before you can use this endpoint.

Creates an company-account with the specified data.

Parameters

  • name string
    • Required
    • Maximum 100 characters
  • timezone.name string
  • billing object
    • billing.address_1 string
      • Maximum 100 characters
    • billing.address_2 string
      • Maximum 100 characters
    • billing.zip_code string
      • Maximum 16 characters
    • billing.city string
      • Maximum 60 characters
    • billing.state string
      • Maximum 60 characters
    • billing.country string
      • Must be a valid country code
    • billing.invoice_email string
      • Must be a valid email
      • Maximum 100 characters
  • phone_number string
    • Maximum 255 characters
  • website string
    • Must be a valid URL
    • Maximum 255 characters
  • vat string
    • Maximum 16 characters
  • language string
  • locale.code string
  • currency string
  • user object
    • user.first_name string
      • Required
      • Maximum 255 characters
    • user.last_name string
      • Required
      • Maximum 255 characters
    • user.email string
      • Required
      • Must be a valid email
      • Must be unique
      • Maximum 100 characters
    • user.password
      • Required
      • Must be more than 6 characters
    • user.timezone.name string
    • user.phone_number string
      • Maximum 255 characters
    • user.job_title string
      • Maximum 255 characters
    • user.system_user boolean - Mark the user as system user.

Deprecated Parameters

  • timezone in favor of timezone.name
    • Removal: 2018/04/01
  • locale in favor of locale.code
    • Removal: 2018/04/01
  • address_1 in favor of billing.address_1
    • Removal: 2018/04/01
  • address_2 in favor of billing.address_2
    • Removal: 2018/04/01
  • zip_code in favor of billing.zip_code
    • Removal: 2018/04/01
  • city in favor of billing.city
    • Removal: 2018/04/01
  • state in favor of billing.state
    • Removal: 2018/04/01
  • country in favor of billing.country
    • Removal: 2018/04/01
  • invoice_email in favor of billing.invoice_email
    • Removal: 2018/04/01
  • user.timezone in favor of user.timezone.name
    • Removal: 2018/04/01

Payload

{
  "name": "A company",
  "timezone": {
    "name": "Europe/Copenhagen"
  },
  "billing": {
    "address_1": "Some address 1",
    "address_2": "Some address 2",
    "zip_code": "123456",
    "city": "A city",
    "state": "A state",
    "country": "dk",
    "invoice_email": "email@example.com"
  },
  "phone_number": "+45 88113344",
  "website": "https://easir.com",
  "locale": {
    "code": "da-DK"
  },
  "currency": "dkk",
  "language": "en",
  "user": {
    "first_name": "Doe",
    "last_name": "John",
    "phone_number": "+4588888888",
    "job_title": "Animal",
    "email": "demo@example.com",
    "timezone": {
      "name": "Australia/Melbourne"
    },
    "password": "secretpassword",
    "system_user": false
  }
}

Response
Status code 201

{
  "id": 102,
  "name": "A company",
  "billing": {
    "invoice_email": "email@example.com",
    "address_1": "Some address 1",
    "address_2": "Some address 2",
    "zip_code": "123456",
    "city": "A city",
    "state": "A state",
    "country": {
      "name": "Denmark",
      "native_name": "Danmark",
      "code": "DK"
    }
  },
  "phone_number": "+45 88113344",
  "website": "https://easir.com",
  "vat": null,
  "logo_1": null,
  "logo_2": null,
  "timezone": {
    "name": "Europe/Copenhagen",
    "offset": 7200
  },
  "locale": {
    "code": "da-DK",
    "language_name": "Danish",
    "country": {
      "name": "Denmark",
      "native_name": "Danmark",
      "code": "DK"
    }
  },
  "language": {
    "code": "en",
    "name": "English"
  },
  "currency": {
    "name": "Danish Krone",
    "name_plural": "Danish kroner",
    "code": "DKK",
    "symbol": "Dkr",
    "symbol_native": "kr",
    "decimal_digits": 2,
    "rounding": 0
  },
  "user": {
    "id": 103,
    "first_name": "Doe",
    "last_name": "John",
    "phone_number": "+4588888888",
    "job_title": "Animal",
    "email": "demo@example.com",
    "email_notifications": false,
    "profile_picture": null,
    "user_type": {
      "id": 1,
      "name": "admin"
    },
    "timezone": {
      "name": "Australia/Melbourne",
      "offset": 36000
    },
    "system_user": false,
    "created_at": "2017-06-29 08:30:26",
    "updated_at": "2017-06-29 08:30:26"
  },
  "plan": {
    "id": 1,
    "name": "standard"
  },
  "created_at": "2017-06-29 08:30:26",
  "updated_at": "2017-06-29 08:30:26"
}

Retrieving a company-account

GET /companies/:company_id

Response
Status code 200

{
  "id": 1,
  "name": "John",
  "billing": {
    "invoice_email": "info@easir.com",
    "address_1": "Savannah 123",
    "address_2": "Under the tree on the left",
    "zip_code": "4730",
    "city": "Umzimkulu",
    "state": "KwaZulu-Natal",
    "country": {
      "name": "South Africa",
      "native_name": "South Africa",
      "code": "ZA"
    }
  },
  "phone_number": "031 308 7900",
  "website": "https://easir.com",
  "vat": "1234567890123456",
  "timezone": {
    "name": "Africa/Johannesburg",
    "offset": 7200
  },
  "locale": {
    "code": "en-US",
    "language_name": "English",
    "country": {
      "name": "United States",
      "native_name": "United States",
      "code": "US"
    }
  },
  "language": {
    "code": "en",
    "name": "English"
  },
  "currency": {
    "name": "US Dollar",
    "name_plural": "US dollars",
    "code": "USD",
    "symbol": "$",
    "symbol_native": "$",
    "decimal_digits": 2,
    "rounding": 0
  },
  "settings": {
    "b2c": {
      "allow": true,
      "default": false
    },
    "theme": "default",
    "product": {
      "mode": "advanced"
    },
    "default_account_id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
    "teams_can_create_relations_paths": true,
    "groups_can_create_relations_paths": true,
    "use_social_lookup": false,
    "support": true
  },
  "plan": {
    "id": 3,
    "name": "premium"
  },
  "created_at": "2014-01-01 12:45:56",
  "updated_at": "2014-01-02 00:11:22"
}

Updating a company-account

PUT /companies/:company_id

Parameters

  • name string
    • Required
    • Maximum 100 characters
  • timezone.name string
  • billing object
    • billing.address_1 string
      • Maximum 100 characters
    • billing.address_2 string
      • Maximum 100 characters
    • billing.zip_code string
      • Maximum 16 characters
    • billing.city string
      • Maximum 60 characters
    • billing.state string
      • Maximum 60 characters
    • billing.country string
      • Must be a valid country code
    • billing.invoice_email string
      • Must be a valid email
      • Maximum 100 characters* phone_number string
    • Maximum 255 characters
  • website string
    • Must be a valid URL
    • Maximum 255 characters
  • vat string
    • Maximum 16 characters
  • language string
  • locale.code string
  • currency string

Deprecated Parameters

  • timezone in favor of timezone.name
  • locale in favor of locale.code
  • address_1 in favor of billing.address_1
  • address_2 in favor of billing.address_2
  • zip_code in favor of billing.zip_code
  • city in favor of billing.city
  • state in favor of billing.state
  • country in favor of billing.country
  • invoice_email in favor of billing.invoice_email

Payload

{
  "name": "A company",
  "timezone": {
    "name": "Europe/Copenhagen"
  },
  "billing": {
    "address_1": "Some address 1",
    "address_2": "Some address 2",
    "zip_code": "123456",
    "city": "A city",
    "state": "A state",
    "country": "dk",
    "invoice_email": "email@example.com"
  },
  "phone_number": "+45 88113344",
  "website": "https://easir.com",
  "locale": {
    "code": "da-DK"
  },
  "currency": "dkk",
  "language": "en"
}

Response
Status code 200

{
  "id": 1,
  "name": "A company",
  "billing": {
    "invoice_email": "email@example.com",
    "address_1": "Some address 1",
    "address_2": "Some address 2",
    "zip_code": "123456",
    "city": "A city",
    "state": "A state",
    "country": {
      "name": "Denmark",
      "native_name": "Danmark",
      "code": "DK"
    }
  },
  "phone_number": "+45 88113344",
  "website": "https://easir.com",
  "vat": null,
  "timezone": {
    "name": "Europe/Copenhagen",
    "offset": 3600
  },
  "locale": {
    "code": "da-DK",
    "language_name": "Danish",
    "country": {
      "name": "Denmark",
      "native_name": "Danmark",
      "code": "DK"
    }
  },
  "language": {
    "code": "en",
    "name": "English"
  },
  "currency": {
    "name": "Danish Krone",
    "name_plural": "Danish kroner",
    "code": "DKK",
    "symbol": "Dkr",
    "symbol_native": "kr",
    "decimal_digits": 2,
    "rounding": 0
  },
  "plan": {
    "id": 3,
    "name": "premium"
  },
  "created_at": "2014-01-01 12:45:56",
  "updated_at": "2015-02-24 07:33:51"
}

Deleting a company-account

DELETE /companies/:company_id

Response
Status code 204

Get company-account settings

GET /companies/:company_id/settings

Response
Status code 200

{
  "b2c": {
      "allow": true,
      "default": true
  },
  "theme": "default",
  "product": {
      "mode": "advanced"
  },
  "default_account_id": "2408705f-bfc1-4ec0-8dc8-f534b5ce1fb9",
  "teams_can_create_relations_paths": true,
  "groups_can_create_relations_paths": true,
  "use_social_lookup": false,
  "support": true
}

Edit company-account settings

PUT /companies/:company_id/settings

When setting product.mode to simple you indicate that you don't want us to calculate prices etc for your products. This will have a impact on activities and reports.

Parameters

  • theme string
    • Can be default, neutral, blue or red
    • default: default
  • product.mode string
    • Can be simple or advanced
    • default: advanced
  • teams_can_create_relations_paths boolean - Whether or not your teams can create their own relations paths.
  • groups_can_create_relations_paths boolean - Whether or not your groups can create their own relations paths.
  • use_social_lookup boolean - If the company is on the premium plan, do you want to use the social lookup.

Payload

{
  "theme": "default",
  "product": {
      "mode": "advanced"
  },
  "teams_can_create_relations_paths": true,
  "groups_can_create_relations_paths": true,
  "use_social_lookup": false
}

Response
Status code 200

{
  "b2c": {
      "allow": true,
      "default": true
  },
  "theme": "default",
  "product": {
      "mode": "advanced"
  },
  "default_account_id": "2408705f-bfc1-4ec0-8dc8-f534b5ce1fb9",
  "teams_can_create_relations_paths": true,
  "groups_can_create_relations_paths": true,
  "use_social_lookup": false,
  "support": true
}

Updating company logos

POST [upload domain]/company-logo

Headers

Content-Type: multipart/form-data

Parameters

Two files are required to upload the company logo, a rectangle of 480x140 (logo_1) and a square logo of 80x80 (logo_2).

  • logo_1 file
    • Required
    • Allowed files (jpg, png, gif, svg)
    • File size maximum 2 megabytes
  • logo_2 file
    • Required
    • Allowed files (jpg, png, gif, svg)
    • File size maximum 2 megabytes

Response
Status code 200

{
  "phone_number": "031 308 7900",
  "website": "https://easir.com",
  "vat": "1234567890123456",
  "logo_1": "http://api.easir.com/filemanager/picture/1/f19f3808-77ac-4d4a-9048-36c40bb62b41/view",
  "logo_2": "http://api.easir.com/filemanager/picture/1/639e5487-d8da-4874-a72e-97cec0c0ec50/view",
  "timezone": {
    "name": "Africa/Johannesburg",
    "offset": 7200
  }
}