Projects

Create a child project

Create a child project using Ovok’s Slim API.

MethodPath
POST/v1/slim/project/child

Authentication · Access policies

Creates a child project under your current project and makes you its admin. Use it to set up a new customer or site below your organisation.

Auth: Bearer token for a project admin. No other role passes. Scope: The new project becomes a direct child of the caller's project (from the token). A project that is itself a child may create children of its own.

Request

Body

NameTypeRequiredDescription
namestringYesProject name. At least 1 character.
idstring (uuid)NoIgnored.
extensionanyNoIgnored.
addressobject[]NoPostal addresses. Omit to have none.
address[].use"work" | "temp" | "old" | "billing"NoPurpose of the address.
address[].type"postal" | "physical" | "both"NoKind of address.
address[].textstringNoThe address as one text.
address[].linestring[]NoStreet lines. Each is a non-empty string.
address[].citystringNoCity.
address[].districtstringNoDistrict.
address[].statestringNoState.
address[].postalCodestringNoPostal code.
address[].countrystringNoCountry.
contactobject[]NoContact persons. Omit to have none.
contact[].telecomobject[]NoWays to reach the contact.
contact[].telecom[].system"email" | "phone" | "fax" | "pager" | "url" | "sms" | "other"NoKind of contact point.
contact[].telecom[].use"work" | "temp" | "old" | "mobile"NoPurpose of the contact point.
contact[].telecom[].valuestringNoThe email address, phone number or URL.
contact[].nameobjectNoThe contact's name.
contact[].name.use"temp" | "old" | "official" | "usual" | "nickname" | "anonymous" | "maiden"NoKind of name.
contact[].name.prefixstring[]NoName prefixes.
contact[].name.givenstring[]NoGiven names.
contact[].name.familystringNoFamily name.
contact[].name.suffixstring[]NoName suffixes.
contact[].addressobjectNoThe contact's address, with the same fields as address[].
settingsobjectNoProject settings.
settings.timeZonestringNoTime zone name, such as Europe/Berlin. Default Europe/Berlin.
settings.trendsPeriodobjectNoThe daily window that trends cover. Omit to use the default.
settings.trendsPeriod.startstringYes, with settings.trendsPeriodStart time as HH:MM:SS.
settings.trendsPeriod.durationSecondsnumberYes, with settings.trendsPeriodLength of the window in seconds. 0 or more.

Behaviour

  • Your project must already hold at least one access policy: the child gets a copy of every access policy of your project. Without one the request is refused with 424 and nothing is created.
  • A second child with exactly the same name under the same parent is refused with 422.
  • The whole create is all or nothing. A failure undoes what was written and answers the failure.
  • On success Ovok:
    • creates the project with practitioner invitations and practitioner login enabled, and practitioner registration plus all patient registration, invitation and login disabled;
    • gives it its own Signals tenant and its own tenant code;
    • links it to your project;
    • copies your practitioner profile into it and adds you as an admin member;
    • seeds its thresholds from the global defaults.
  • The organization stored inside the project is built from name, address, contact and settings. settings.timeZone defaults to Europe/Berlin. id and extension in the body are ignored.
  • When the platform has it enabled, an Ovok support account is also added as a non-admin member holding the child's System Owner access policy. It is skipped when the child has no single policy of that name. This step never fails the create.
  • Child project lists are refreshed right away.
  • Returns { "projectId": "<new project id>", "success": true }.

Example

curl -X POST 'https://api.sandbox.ovok.com/v1/slim/project/child' \
  -H "Authorization: Bearer ${OVOK_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example project",
    "contact": [{ "telecom": [{ "system": "email", "use": "work", "value": "team@example.com" }] }],
    "settings": { "timeZone": "Europe/Berlin" }
  }'

Successful response

201 — The child project was created successfully.

{ "projectId": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68", "success": true }
FieldTypeDescription
projectIdstring (uuid)Id of the new child project.
successbooleanAlways true.

Errors

StatusMeaning
400The project or its Signals tenant could not be created.
401The bearer token is missing or invalid, or the session carries no project, user or profile.
403The caller is not a project admin.
409Another create of the same name under the same parent is in progress.
422The body fails validation, or your project already has a child project with this name.
424Your project has no access policy to copy into the child. Nothing was created; retry once it has one.
503The Signals tenant of the new project cannot be set up. Nothing was created. Retry shortly.

Last updated on

On this page