Organizations
#
IntroductionAn organization is created by an end-user. Inside it, they can create boxes and administrate them. These boxes are then owned by the organization.
There is always at least one organization within the system, corresponding to what is called the "self org". The "self org" corresponds to the Open ID Provider client and represents the instance of the system running.
While end-users create boxes in their personal space, it is linked to this self-organization which represent then the personal space for all the users on this instance. Self organization has no administrators, the data linked to it belongs to the end-users that have created it.
#
Organizations#
Creating an Organization#
RequestCookies:
accesstoken
(opaque token) (ACR >= 2): no identity check, just a valid token is required.tokentype
: must bebearer
Headers:
X-CSRF-Token
: a token to prevent from CSRF attacks.
JSON Body:
name
(string) (max length: 255).pubkey
(optional) (unpadded URL-safe base64) the organization's public keysecret_storage
(optional) initial data for the organization's secret storage:account_root_key_hash
is the (SHA-512) hash of the organization's root keyasym_keys
maps public keys to their secret key (encrypted with the root key)
Use the secret_storage
field to store the secret key corresponding to the org's public key.
#
Response_
JSON Body:
with attributes:
id
: (string, uuid) the unique id of the organization.name
: (string) the name of the organization.current_identity_role
: (string) (nullable) (one of: admin) the role for the current identity for this organization. null is no special role attributed.creator_id
: (string, uuid) the id of the identity who has created the organization.created_at
: (date) the date of creation of the org.
#
Generating a Secret for an OrganizationThis request is idempotent. As the secret is unknown to the server, generating a secret will always answer with a new secret either there is an existing secret for the organization.
The secret is generated by the server and returned as json body once for all. It will be never possible to retrieve it again, the server does not store it in a raw version.
#
RequestCookies:
accesstoken
(opaque token) (ACR >= 2):mid
should be an admin of the organization.tokentype
: must bebearer
Headers:
X-CSRF-Token
: a token to prevent from CSRF attacks.
Path parameters:
id
: (uuid) unique id of the organization.
#
Response_
JSON Body:
#
Listing organizations for the current identity#
RequestCookies:
accesstoken
(opaque token) (ACR >= 1):mid
claim as the identity id.tokentype
: must bebearer
Headers:
X-CSRF-Token
: a token to prevent from CSRF attacks.
Path Parameters:
id
(uuid string): the box id wished to be retrieved.
#
ResponseCode:
JSON Body:
with attributes:
id
: (string, uuid) the unique id of the organization.name
: (string) the name of the organization.current_identity_role
: (string) (nullable) (one of: admin) the role for the current identity for this organization. null is no special role attributed.creator_id
: (string, uuid) the id of the identity who has created the organization.created_at
: (date) the date of creation of the org.
#
Getting public info about an organizationThis endpoint does not need any valid token.
#
RequestPath Parameters:
id
(uuid string): the organization id wished to be retrieved.
#
ResponseCode:
JSON Body:
#
Adding an agentAn agent
wiil be able to create boxes in the organization.
An agent
is different from the creator
of the organization.
The creator
is the only one who can create, remove and list agents.
#
RequestCookies:
accesstoken
(opaque token) (ACR >= 2): identity must be creator of the organizationtokentype
: must bebearer
Headers:
X-CSRF-Token
: a token to prevent from CSRF attacks.
JSON Body:
email
(string): email of the new agent
#
Response_
JSON Body:
with attributes:
id
: (int) the unique id of the agent role.organization_id
: (string, uuid) the id of the organization.identity_id
: (string, uuid) the identity id of the agent.created_at
: (date) the date of creation of the agent.
#
Listing org agents#
RequestCookies:
accesstoken
(opaque token) (ACR >= 2): identity must be creator of the organizationtokentype
: must bebearer
Headers:
X-CSRF-Token
: a token to prevent from CSRF attacks.
Query Parameters:
limit
: (int, optional) the pagination limitoffset
: (int, optional) the pagination offset
#
Response_
JSON Body:
with attributes:
id
: (int) the unique id of the agent role.organization_id
: (string, uuid) the id of the organization.identity_id
: (string, uuid) the identity id of the agent.created_at
: (date) the date of creation of the agent.identity
: (json) some more information about the agent identity.
#
Counting org agents#
RequestCookies:
accesstoken
(opaque token) (ACR >= 2): identity must be creator of the organizationtokentype
: must bebearer
#
ResponseHeaders:
X-Total-Count
(integer): the total count of agents in the organization.