API Docs

Countries & Departments

Countries and departments form part of the organisational structure for users within Flowcase. This guide describes the APIs to read and change them.

An account spans many countries, each country holds many departments, and each department holds many users.

NOTE: There is a difference in terminology between the UI and the API. What are known as "Departments" in the UI are called "Offices" within the API due to historical reasons.

Country and language codes

The country endpoints below accept a use_legacy_codes option. It determines whether ISO standard country and language codes are used, or Flowcase's legacy codes. Set it to false to use ISO codes. See Country & Language Codes for both sets of codes.

Listing countries and departments

GET https://<subdomain>.flowcase.com/api/v1/countries?use_legacy_codes=false

Response body

[
  {
    "_id": "<country_id>",
    "code": "<country_code>",
    "native_language_code": "<language_code>",
    "offices": [
      {
        "_id": "<department_id>",
        "name": "<department_name>",
        "country_id": "<country_id>",
        "country_code": "<country_code>",
        "override_language_code": "<language_code>",
        "num_users": 34, // Number of users in the department
        "num_users_activated": 32, // Number of activated users in the department
        "num_users_deactivated": 2 // Number of deactivated users in the department
      }
      // More departments
    ]
    // Some fields have been omitted
  }
  // More countries
]

Countries

Creating countries

POST https://<subdomain>.flowcase.com/api/v1/countries?use_legacy_codes=false

Request body

{
  "country": {
    "code": "<country_code>",
    "native_language_code": "<language_code>",
    "override_ui_language_code": "<language_code>", // optional
    "cv_template_id": "<template_id>", // optional
    "cv_template_type": "<template_type>" // only specify if template_id is provided. Allowed values are 'word' or 'json'
  }
}

Updating countries

PUT https://<subdomain>.flowcase.com/api/v1/countries/<country_id>?use_legacy_codes=false

Request body

Only specify the fields you wish to change.

{
  "country": {
    "code": "<country_code>",
    "native_language_code": "<language_code>",
    "override_ui_language_code": "<language_code>", // optional
    "cv_template_id": "<template_id>",
    "cv_template_type": "<template_type>" // only specify if template_id is provided. Allowed values are 'word' or 'json'
  }
}

Departments

Creating departments

POST https://<subdomain>.flowcase.com/api/v1/countries/<country_id>/offices

Request body

{
  "name": "<department_name>", // Required, must be unique within country
  "override_language_code": "<language_code>" // Optional
}

Updating departments

PUT https://<subdomain>.flowcase.com/api/v1/countries/<country_id>/offices/<department_id>

Request body

Only provide the fields that you wish to update.

{
  "name": "<department_name>",
  "override_language_code": "<language_code>"
}

Deleting departments

Before deleting the department you must ensure the department is empty and has no users, otherwise you'll receive a 400 response code.

DELETE https://<subdomain>.flowcase.com/api/v1/countries/<country_id>/offices/<department_id>