Projects
Update a project
Update a project using Ovok’s Slim API.
| Method | Path |
|---|---|
PUT | /v1/slim/project/:id |
Authentication · Access policies
Updates a project's name, address, contact and settings, and returns the updated project. Use it to edit your project or one of its child projects.
Auth: Bearer token of a project admin (ProjectMembership.admin).
Scope: The project in the path. It must be the caller's project (from the token) or a direct child of it.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | Project id. Your own project or a direct child of it. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name. At least 1 character. |
id | string (uuid) | No | Ignored. |
extension | any | No | Ignored. |
address | object[] | No | Postal addresses. Omit to have none. |
address[].use | "work" | "temp" | "old" | "billing" | No | Purpose of the address. |
address[].type | "postal" | "physical" | "both" | No | Kind of address. |
address[].text | string | No | The address as one text. |
address[].line | string[] | No | Street lines. Each is a non-empty string. |
address[].city | string | No | City. |
address[].district | string | No | District. |
address[].state | string | No | State. |
address[].postalCode | string | No | Postal code. |
address[].country | string | No | Country. |
contact | object[] | No | Contact persons. Omit to have none. |
contact[].telecom | object[] | No | Ways to reach the contact. |
contact[].telecom[].system | "email" | "phone" | "fax" | "pager" | "url" | "sms" | "other" | No | Kind of contact point. |
contact[].telecom[].use | "work" | "temp" | "old" | "mobile" | No | Purpose of the contact point. |
contact[].telecom[].value | string | No | The email address, phone number or URL. |
contact[].name | object | No | The contact's name. |
contact[].name.use | "temp" | "old" | "official" | "usual" | "nickname" | "anonymous" | "maiden" | No | Kind of name. |
contact[].name.prefix | string[] | No | Name prefixes. |
contact[].name.given | string[] | No | Given names. |
contact[].name.family | string | No | Family name. |
contact[].name.suffix | string[] | No | Name suffixes. |
contact[].address | object | No | The contact's address, with the same fields as address[]. |
settings | object | No | Project settings. |
settings.timeZone | string | No | Time zone name, such as Europe/Berlin. Default Europe/Berlin. |
settings.trendsPeriod | object | No | The daily window that trends cover. Omit to use the default. |
settings.trendsPeriod.start | string | Yes, with settings.trendsPeriod | Start time as HH:MM:SS. |
settings.trendsPeriod.durationSeconds | number | Yes, with settings.trendsPeriod | Length of the window in seconds. 0 or more. |
Behaviour
- Sets the project
nameand replaces the organization stored inside the project with one built fromname,address,contactandsettings. This is a full replace, not a merge:- an omitted
addressorcontactclears it; - an omitted
settings.timeZoneresets the time zone toEurope/Berlin; - an omitted
settings.trendsPeriodremoves the stored trends period, so reads fall back to the default.
- an omitted
idandextensionin the body are ignored. The project comes from the path.settings.trendsPeriod.startmust beHH:MM:SS.- The response has the shape of
GET /v1/slim/project/{id}.
Example
curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/project/b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68' \
-H "Authorization: Bearer ${OVOK_TOKEN}" \
-H 'Content-Type: application/json' \
-d '{
"name": "Example project",
"address": [{ "line": ["Hauptstrasse 1"], "city": "Berlin", "postalCode": "10115", "country": "DE" }],
"settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
}'Successful response
200 — The project was updated successfully.
{
"resourceType": "Project",
"id": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68",
"name": "Example project",
"address": [{ "line": ["Hauptstrasse 1"], "city": "Berlin", "postalCode": "10115", "country": "DE" }],
"settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
}The body is the updated project, as GET /v1/slim/project/{id} returns it.
| Field | Type | Description |
|---|---|---|
resourceType | "Project" | Always Project. |
id | string (uuid) | Project id. |
name | string | Project name. The project id when the project has no name. |
address | object[] | Postal addresses of the project. Left out when there are none. Each entry has the fields of address[] in the request: use, type, text, line, city, district, state, postalCode and country. |
contact | object[] | Contact persons of the project. Left out when there are none. Each entry has the fields of contact[] in the request: telecom, name and address. |
settings | object | Project settings. |
settings.timeZone | string | Time zone name. Europe/Berlin when none is stored. |
settings.trendsPeriod | object | The daily window that trends cover. |
settings.trendsPeriod.start | string | Start time as HH:MM:SS. 09:00:00 when none is stored. |
settings.trendsPeriod.durationSeconds | number | Length of the window in seconds. 86400 when none is stored. |
Errors
| Status | Meaning |
|---|---|
400 | The project is neither the caller's project nor a direct child of it, or it cannot be read. |
401 | The bearer token is missing or invalid, or the session carries no project. |
403 | The session is not a project admin session. |
404 | No project has this id. |
422 | id is not a UUID, or the body fails validation. |
Last updated on