Organisations

Updated

The organisation resource helps link together all other API resources that relate to a client of the API (here a client is an API customer, not an API client implementation).

An organisation must be configured before its API keys can be used to perform data retrieval operations against the API. Without at least a valid storage configuration the API won't know how to publish results.

An organisation keeps track of a set of base permissions. These describe what operations keys within the organisation are allowed to perform against the API.

Attributes

name type description
id organisation ID Resource identifier.
resource string, always organisation Resource type specifier.
type super, string One of: standard, super.
name string The chosen name for the organisation.
slug string The slugified version of name.
permissions permissions resource Nested permissions resource.
storage_configs list of storage config resources Nested list of storage config objects associated with the organisation.
storage_config_default optional, storage config ID The ID of the organisation's default storage config.
webhook_configs list of webhook config resources Nested list of webhook config objects associated with the organisation.
webhook_config_default optional, webhook config ID The ID of the organisation's default webhook config.
state string One of: unconfigured, active, deactivated, blocked.
date_created datetime When the resource was created.

Types

standard
For clients of the API.
super
For internal managers of the API.

Permissions

The permissions value specifies the set of base permissions for the organisation. These are the least strict permissions afforded to any sub-resource of that organisation, i.e. a key or a user cannot have access to more data than the organisation it belongs to.

States

unconfigured
Every organisation is created in this state. Being in this state blocks access to most data-retrieval functionality.
active
The organisation has been configured and can use all parts of the API.
deactivated
The organisation has been shut-down on request of the owner.
blocked
The organisation has been shut-down by an API administrator.

Retrieve GET /organisation

Using cURL

curl https://ricloud-api.reincubate.com/organisation \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

ricloud.Organisation.retrieve()

Sample response

{
  "id": 1,
  "resource": "organisation",
  "name": "My org",
  "slug": "my-org",
  "permissions": {
      "id": 1,
      "resource": "organisation_permissions",
      "identifier": "default",
      "scopes": {
          "source_type:icloud.*": [],
          "task_type:*": [],
          "data_type:icloud.account.info": [],
      },
      "date_created": "2018-11-08T13:05:29.954188Z"
  },
  "storage_configs": [
    {
      "id": 1,
      "resource": "storage_config",
      "type": "gs",
      "url": "gs://my-storage-bucket",
      "credentials": {},
      "state": "valid",
      "date_created": "2018-11-08T16:47:56.849618Z"
    }
  ],
  "storage_config_default": 1,
  "webhook_configs": [
    {
      "id": 1,
      "resource": "webhook_config",
      "url": "https://www.mywebhookendpoint.com/webhooks",
      "secret": "Wg69dQaffJuXckXsdoHuPYkf3VSWEGMa",
      "state": "valid",
      "date_created": "2018-11-08T13:07:59.563975Z"
    }
  ],
  "webhook_config_default": 1,
  "state": "active",
  "date_created": "2018-11-08T13:05:29.784270Z"
}

Update POST /organisation

Parameters

name type description
name string Change the display name of your organisation.
storage_config_default storage config ID Change the default storage config used by your organisation.
webhook_config_default webhook config ID Change the default webhook config used by your organisation.

Using cURL

curl 'https://ricloud-api.reincubate.com/organisation' \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My new organisation name"
}'

Using ricloud-py

import ricloud

ricloud.Organisation.update(name='My new org')

Sample response. Note that the slug attribute does not change, as it is only generated on initial organisation creation.

{
  "id": 1,
  "resource": "organisation",
  "name": "My new org",
  "slug": "my-org",
  "permissions": {},
  "storage_configs": [
    {
      "id": 1,
      "resource": "storage_config",
      "type": "gs",
      "url": "gs://my-storage-bucket",
      "credentials": {},
      "state": "valid",
      "date_created": "2018-11-08T16:47:56.849618Z"
    }
  ],
  "storage_config_default": 1,
  "webhook_configs": [
    {
      "id": 1,
      "resource": "webhook_config",
      "url": "https://www.mywebhookendpoint.com/webhooks",
      "secret": "Wg69dQaffJuXckXsdoHuPYkf3VSWEGMa",
      "state": "valid",
      "date_created": "2018-11-08T13:07:59.563975Z"
    }
  ],
  "webhook_config_default": 1,
  "state": "active",
  "date_created": "2018-11-08T13:05:29.784270Z"
}

How can we help?

Our support team are here to help!

Our office hours are Monday to Friday, 9am to 5pm GMT.

We aim to reply to all messages within one working day.

Get in touch › Our awesome support team

© 2008 - 2019 Reincubate Ltd. All rights reserved. Registered in England and Wales #5189175, VAT GB151788978. Reincubate® is a registered trademark. Privacy & terms. We recommend 2FA. Built with in London.