Create an organisation and a workspace
This guide creates an organisation, then a workspace inside it. Each call returns an operation record that comes back already completed.
Before you begin
Section titled “Before you begin”- Authentication. Export an API token as
$QIBDO_API_TOKENand the base URL as$QIBDO_API_BASE. See Authenticate a user and manage the session. - Permissions. Your IAM user, which you set as the organisation owner, needs permission to create organisations. See the authorization model.
- Prerequisites. A qibdo-cloud account.
Step 1: Create the organisation
Section titled “Step 1: Create the organisation”Send a POST with the organisation’s name and the IAM user id that owns it.
Identifiers and timestamps are assigned for you, so leave them out:
curl -X POST "$QIBDO_API_BASE/taxonomy/v1/organisations" \ -H "Authorization: Bearer $QIBDO_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Corp", "owner_user_id": "11111111-1111-1111-1111-111111111111" }'The call completes synchronously and returns an operation record already marked
done. The new organisation’s id is in the record’s resource_id. Capture it:
export ORG_ID="22222222-2222-2222-2222-222222222222"Step 2: Create a workspace in the organisation
Section titled “Step 2: Create a workspace in the organisation”Send a POST to the organisation’s workspaces, with the workspace name. Without
a group, the workspace sits at the organisation root; you can move it into a
group later.
curl -X POST "$QIBDO_API_BASE/taxonomy/v1/organisations/$ORG_ID/workspaces" \ -H "Authorization: Bearer $QIBDO_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "production" }'The response is again an operation, already done; the new workspace’s id is in
its resource_id.
Step 3: Verify
Section titled “Step 3: Verify”Read the workspace back with a GET:
curl "$QIBDO_API_BASE/taxonomy/v1/organisations/$ORG_ID/workspaces/<workspace-id>" \ -H "Authorization: Bearer $QIBDO_API_TOKEN"The response is the workspace, including the organisation it belongs to.
Next steps
Section titled “Next steps”- Understand the model behind these calls: Resource hierarchy.