Clients

View, create, update existing clients, and manage clients for all client accounts belonging to the requesting company.

GET /clients

DescriptionCollects a list of all the clients associated with the requesting account. Users with admin role privileges have access to all clients.
Permissionsclient.access
Resource URLhttps://app.klipfolio.com/api/1.0/clients
Parameters

external_id (string) — show only clients that have the specified external id

status (active, trial, setup, disabled) — show only clients that have the specified account status.

Example Requests

GET https://app.klipfolio.com/api/1/clients
GET https://app.klipfolio.com/api/1.0/clients?status=active

Example Response

{
    "meta": {
        "success": true,
        "status": 200,
        "count": 3,
        "total": 3
    },
    "data": {
        "clients": [
            {
                "id": "0123456789abcdef0123456789abcdef",
                "name": "Company A",
                "description": "Testing for demo",
                "status": "Active",
                "seats": -1,
                "last_sign_in": "2015-02-26T23:58:29Z"
            },
            {
                "id": "0123456789abcdef0123456789abcdef",
                "name": "Company B,
                "description": "Marketing",
                "status": "Active",
                "seats": -1,
                "last_sign_in": "2017-03-02T18:03:07Z"
            },
            {
                "id": "0123456789abcdef0123456789abcdef",
                "name": "Company C",
                "description": "Stats for Google Analytics",
                "status": "Active",
                "seats": -1,
                "last_sign_in": null
            }
        ]
    }
}

Note: The external_id is not shown if the client’s external ID is null

GET /clients/{id}

DescriptionGet the details for the specified client.
Resource URLhttps://app.klipfolio.com/api/1.0/clients/{id}
Permissionsclient.access
Parametersfull (true/false) — include associations in the listing (users, groups, share_right)

Example Request

GET https://app.klipfolio.com/api/1/clients/0123456789abcdef0123456789abcdef?full=true

Example Response

Note: custom_theme is shown only if the feature is enabled in the parent account
external_id is not shown if the client’s external id is null
trial_remaining is shown only if the client is a trial user

{
   "data": {
       "custom_theme": true,
       "description": Company C,
       "groups": [
           "0123456789abcdef0123456789abcdef",
           "23456789abcdef0123456789abcdef01",
           "456789abcdef0123456789abcdef0123"
       ],
       "id": "0123456789abcdef0123456789abcdef",
       "is_direct_billed": false,
       "last_sign_in": null,
       "name": "Client C",
       "primary_contact": null,
       "seats": 50,
       "share_rights": [
           {
               "group_id": "6789abcdef0123456789abcdef012345",
               "group_name": "Management",
               "can_manage": true
    }],
       "status": "Trial",
       "trial_remaining": 5,
       "users": [
           "0123456789abcdef0123456789abcdef",
           "23456789abcdef0123456789abcdef01",
           "456789abcdef0123456789abcdef0123"
       ]
   },
   "meta": {
       "status": 200,
       "success": true
   }
}

POST /clients

DescriptionCreate a client.
Resource URLhttps://app.klipfolio.com/api/1.0/clients
Permissionsclient.build
Fieldsname, description, status, seats (optional), custom_theme (optional), external_id (optional)

Example Request

Note: 'status' can be 'setup', 'trial', 'active' or 'disabled'. 'custom_theme' is optional, optionally include 'external_id' in the post data to add an external id to the new client

POST https://app.klipfolio.com/api/1/clients -d {
 'name': 'Client From API',
 'description': 'Hello there',
 'seats': 20,
 'status': 'trial',
 'custom_theme': true
}

Example Response

{
   "data": {},
   "meta": {
       "location": "/clients/0123456789abcdef0123456789abcdef",
       "status": 201,
       "success": true
   }
}

PUT /clients/{id}

DescriptionUpdate the specified client.
Permissionsclient.edit
Resource URLhttps://app.klipfolio.com/api/1.0/clients/{id}
Fieldsname, description, status, seats, custom_theme, external_id

Example Request

PUT https://app.klipfolio.com/api/1/clients/0123456789abcdef0123456789abcdef -d {"status": "disabled"}

Example Response

{
   "data": {},
   "meta": {
       "status": 200,
       "success": true
   }
}

DELETE /clients/{id}

DescriptionDelete a client.
Permissionsclient.delete
Resource URLhttps://app.klipfolio.com/api/1.0/clients/{id}
ParametersNone.

Example Request

DELETE https://app.klipfolio.com/api/1/clients/0123456789abcdef0123456789abcdef

Example Response

{
   "data": {},
   "meta": {
       "status": 200,
       "success": true
   }
}

POST /clients/{id}/@/enable_direct_billing

DescriptionSwitch a client to direct billing. This cannot be undone. This command is only available to Partner accounts.
Permissionsclient.access
Resource URLhttps://app.klipfolio.com/api/1.0/clients/{id}/@/enable_direct_billing
FieldsNone.

Example Request

POST https://app.klipfolio.com/api/1/clients/0123456789abcdef01234589abcdef/@/enable_direct_billing

Example Response

{
  "data": {
      "op_requested":"enable_direct_billing"
  },
  "meta": {
      "status": 200,
      "success": true
  }
}

POST /clients/{id}/@/extend_trial

DescriptionExtend a client’s trial period.
Permissionsclient.access
Resource URLhttps://app.klipfolio.com/api/1.0/clients/{id}/@/extend_trial
FieldsNone.

Example Request

POST https://app.klipfolio.com/api/1/clients/0123456789abcdef0123456789abcdef/@/extend_trial -d {'days':'7'}

Example Response

{
  "data": {
      "op_requested":""extend_trial"
  },
  "meta": {
      "status": 200,
      "success": true
  }
}