Visena Dokumentasjon
Partner API

Ressurs

Project

Prosjekter — arbeidsenheten selskaper og aktiviteter henger på. Full CRUD; oppretting krever en templateId, og sletting lukker prosjektet i stedet for å slette det.

I origo er et prosjekt et oppdrag — arbeidsenheten en kunde engasjerer firmaet for. Det hører til et selskap, det eies av en gruppe, og aktiviteter henger på det; det er ikke et programvareprosjekt. projectType navngir de to formene et oppdrag kan ha, PROJECT_TYPE_PROJECT og PROJECT_TYPE_ASSIGNMENT.

Endepunktreferansen under står på engelsk i begge språktrærne. Den gjengir API-kontrakten ordrett, og det finnes ingen generator å bygge den på nytt fra, så en oversatt kopi ville drevet fra API-et første gang et endepunkt endres.

Endepunkter

Åtte endepunkter, i samme rekkefølge som de er dokumentert nedenfor.

Alle endepunktene på denne siden kan i tillegg svare med fellesfeilene — 401, 403, 404 (ukjent instans) og 500. De er dokumentert én gang, under Feil og feilsøking.

Create a project

POST /{instanceName}/api/v1/{locale}/project

Creates a project from a template and returns the full entity. 201 with a Location header.

Forespørselskropp

application/jsonProjectCreateDto

Svar

Status Beskrivelse
201 Project created.
ProjectResponseDto · application/json
400 Request body failed validation.
422 A referenced entity (template, company, ownerGroup, parent, responsible, createdBy, modifiedBy) does not exist.

Eksempel

curl
curl -X POST "https://api.visena.example/acme/api/v1/en/project" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Warehouse rollout",
    "templateId": "tM2qL6",
    "ownerGroupId": "gH8dF3",
    "companyId": "bQ4wR8"
  }'

Get a project

GET /{instanceName}/api/v1/{locale}/project/{projectId}

Returns the full entity. 404 if unknown; 400 if the id cannot be unmasked.

Parametere

Parameter Plassering Type Beskrivelse
projectId required path string Masked project id.

Svar

Status Beskrivelse
200 The project.
ProjectResponseDto · application/json
400 The id is not a valid id.
404 No project with that id.

Eksempel

curl
curl "https://api.visena.example/acme/api/v1/en/project/pJ7wN2" \
  -H "Authorization: Bearer $TOKEN"

List projects (offset-paginated)

GET /{instanceName}/api/v1/{locale}/project

Offset/limit paging with a real total. Optional filters: isActive, companyId; and a created/modified/name sort. RFC 8288 navigation links are in the body.

Parametere

Parameter Plassering Type Beskrivelse
offset query integer
default 0
Zero-based item offset.
limit query integer Maximum items to return per page.
isActive query boolean Filter on active state.
companyId query string Masked company id.
sort query string Sort key; the endpoint description lists the allowed values.

Svar

Status Beskrivelse
200 A page of projects with totals and navigation links.
ProjectOffsetListResponse · application/json
400 Invalid paging or sort parameter, or a filter id is not a valid id.

Eksempel

curl
curl "https://api.visena.example/acme/api/v1/en/project?offset=0&limit=20" \
  -H "Authorization: Bearer $TOKEN"

List projects (cursor-paginated, insert-stable)

GET /{instanceName}/api/v1/{locale}/project/cursor

Keyset paging over the monotonic entity id (insertion order). Pass the opaque cursor from a previous page's nextCursor/prevCursor; omit it for the first page. No total. Same filters as the offset list: isActive, companyId.

Markørpaginering og tidslinjen under er to ulike lesemoduser, ikke to sideformater. Hvilken som passer for et engangsuttrekk, hvilken du gjenopptar fra, om en rad kan komme to ganger, og hva et listesvar sier når et prosjekt forsvinner, er avgjort én gang for hele API-et i Lister, paginering og synk — les den før du bygger en synkroniseringsløkke på dette endepunktet eller på listProjectsByTime.

Parametere

Parameter Plassering Type Beskrivelse
cursor query string Opaque page cursor from the previous response's links.next; omit for the first page.
limit query integer Maximum items to return per page.
isActive query boolean Filter on active state.
companyId query string Masked company id.

Svar

Status Beskrivelse
200 A page of projects with next/prev cursors and links.
ProjectCursorListResponse · application/json
400 Invalid or expired cursor, or invalid limit.

Eksempel

curl
curl "https://api.visena.example/acme/api/v1/en/project/cursor?limit=100" \
  -H "Authorization: Bearer $TOKEN"

List projects (time-windowed, cursor-paginated)

GET /{instanceName}/api/v1/{locale}/project/timeline

Keyset paging from an optional since lower bound on the coalesced modified-or-created timestamp. RFC 9557 Z timestamps.

Parametere

Parameter Plassering Type Beskrivelse
since query string (date-time) Inclusive lower bound — an RFC 3339 timestamp.
cursor query string Opaque page cursor from the previous response's links.next; omit for the first page.
limit query integer Maximum items to return per page.

Svar

Status Beskrivelse
200 A page of projects with next/prev cursors and links.
ProjectCursorListResponse · application/json
400 Invalid timestamp, cursor, or limit.

Eksempel

curl
curl "https://api.visena.example/acme/api/v1/en/project/timeline?since=2026-08-20T02:00:00Z" \
  -H "Authorization: Bearer $TOKEN"

Replace a project

PUT /{instanceName}/api/v1/{locale}/project/{projectId}

Full replace (PUT): omitted optional fields are cleared.

Parametere

Parameter Plassering Type Beskrivelse
projectId required path string Masked project id.

Forespørselskropp

application/jsonProjectUpdateDto

Svar

Status Beskrivelse
200 The replaced project.
ProjectResponseDto · application/json
400 Request body failed validation, or the id is not a valid id.
404 No project with that id.
422 A referenced entity (template, company, ownerGroup, parent, responsible, modifiedBy) does not exist.

Eksempel

curl
curl -X PUT "https://api.visena.example/acme/api/v1/en/project/pJ7wN2" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Warehouse rollout",
    "templateId": "tM2qL6",
    "ownerGroupId": "gH8dF3",
    "companyId": "bQ4wR8"
  }'

Partially update a project (RFC 7396 JSON Merge Patch)

PATCH /{instanceName}/api/v1/{locale}/project/{projectId}

Absent fields are unchanged, JSON null clears, a value sets. An empty body {} is a no-op. Wrong content type → 415.

Parametere

Parameter Plassering Type Beskrivelse
projectId required path string Masked project id.

Forespørselskropp

application/merge-patch+jsonobject

Svar

Status Beskrivelse
200 The updated project.
ProjectResponseDto · application/json
400 A patched field had an invalid value, or the id is not a valid id.
404 No project with that id.
415 Content-Type was not application/merge-patch+json.
422 A referenced entity (template, company, ownerGroup, parent, responsible, modifiedBy) does not exist.

Eksempel

curl
curl -X PATCH "https://api.visena.example/acme/api/v1/en/project/pJ7wN2" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{
    "name": "Warehouse rollout — phase 2"
  }'

Delete (close) a project

DELETE /{instanceName}/api/v1/{locale}/project/{projectId}

Soft-close: sets the project inactive through the same flow the Visena UI uses. 204 on success.

Parametere

Parameter Plassering Type Beskrivelse
projectId required path string Masked project id.

Svar

Status Beskrivelse
204 Project closed; no body.
400 The id is not a valid id.
404 No project with that id.

Eksempel

curl
curl -X DELETE "https://api.visena.example/acme/api/v1/en/project/pJ7wN2" \
  -H "Authorization: Bearer $TOKEN"

Objektstrukturer

Forespørsels- og svarkroppene som brukes over, i den rekkefølgen de først refereres.

ProjectCreateDto

Felt Type Beskrivelse
name required string Project display name. Required.
companyId string (masked id)
templateId required string (masked id)
ownerGroupId required string (masked id)
parentId string (masked id)
responsiblePersonId string (masked id)
projectYear object Project year.
estimatedStart string (date-time) Estimated start (RFC 3339).
estimatedEnd string (date-time) Estimated end (RFC 3339).
projectStart string (date-time) Actual start (RFC 3339). Defaults to the creation timestamp when absent.
projectEnd string (date-time) Actual end (RFC 3339).
externalReference string External reference / foreign system key.
internalReference string Internal reference.
isPublicAccess object Whether the project is visible across the tenant (public access). Defaults from the template.
isChargable object Whether the project is chargeable. Defaults from the template.
created string (date-time) override: creation timestamp to attribute. Defaults to server-now (UTC) when absent.
createdBy string (masked id)
modified string (date-time) override: modification timestamp (set alongside creation when provided).
modifiedBy string (masked id)

ProjectResponseDto

Felt Type Beskrivelse
id string (masked id)
number string Human-readable project number, assigned by Visena.
name string
company CompanyRefDto
template ProjectTemplateRefDto
ownerGroup GroupRefDto
projectYear object Project year, if set.
parentId string (masked id)
responsible string (masked id)
projectType string, one of PROJECT_TYPE_PROJECT PROJECT_TYPE_ASSIGNMENT
estimatedStart string (date-time) Estimated start (UTC), if set.
estimatedEnd string (date-time) Estimated end (UTC), if set.
projectStart string (date-time) Actual start (UTC).
projectEnd string (date-time) Actual end (UTC), if set.
externalReference string
internalReference string
isPublicAccess boolean
isChargable boolean
isActive boolean
created string (date-time) Creation timestamp (UTC).
createdBy string (masked id)
modified string (date-time) Last-modification timestamp (UTC); null until first modified.
modifiedBy string (masked id)
actedBy string (masked id)

CompanyRefDto

The company the owning project belongs to, if any.

Felt Type Beskrivelse
id string (masked id)
name string Company display name.
organizationalNumbers array of OrgNumberDto Active organizational (registration) numbers; at most one per company.

OrgNumberDto

Active organizational (registration) numbers; at most one per company.

Felt Type Beskrivelse
orgNumber string The organizational (registration) number.
country CountryRefDto

CountryRefDto

Country this organizational number is registered in.

Felt Type Beskrivelse
id string (masked id)
name string Country display name.
code string ISO 3166-1 alpha-2 country code, e.g. "NO".

ProjectTemplateRefDto

Project template the project was created from.

Felt Type Beskrivelse
id string (masked id)
name string Project template display name.

GroupRefDto

Owning group / department.

Felt Type Beskrivelse
id string (masked id)
name string Group display name.

ProjectOffsetListResponse

Felt Type Beskrivelse
totalItems integer Total number of matching projects.
totalPages integer Total number of pages at the current page size.
page integer Zero-based index of the current page.
size object Page size actually applied.
items array of ProjectListItemDto The projects on this page.
links ProjectListLinks

ProjectListItemDto

The projects on this page, in ascending key order.

Felt Type Beskrivelse
id string (masked id)
name string Project display name.
number string Human-readable project number, if assigned.
isActive boolean Whether the project is active.
projectYear object Project year, if set.
projectType string, one of PROJECT_TYPE_PROJECT PROJECT_TYPE_ASSIGNMENT
company CompanyRefDto
ownerGroup GroupRefDto
responsible string (masked id)
projectStart string (date-time) Actual start (UTC).
projectEnd string (date-time) Actual end (UTC), if set.
created string (date-time) Creation timestamp (UTC).
modified string (date-time) Last-modification timestamp (UTC); null until first modified.

RFC 8288 navigation links.

Felt Type Beskrivelse
self string URL of the current page.
first string URL of the first page (offset endpoint).
prev string URL of the previous page, if any.
next string URL of the next page, if any.
last string URL of the last page (offset endpoint).

ProjectCursorListResponse

Felt Type Beskrivelse
items array of ProjectListItemDto The projects on this page, in ascending key order.
nextCursor string Opaque cursor for the next page; absent on the last page.
prevCursor string Opaque cursor for the previous page; absent on the first page.
links ProjectListLinks

ProjectUpdateDto

Felt Type Beskrivelse
name required string Project display name. Required.
companyId string (masked id)
templateId required string (masked id)
ownerGroupId required string (masked id)
parentId string (masked id)
responsiblePersonId string (masked id)
projectYear object Project year.
estimatedStart string (date-time) Estimated start (RFC 3339).
estimatedEnd string (date-time) Estimated end (RFC 3339).
projectStart string (date-time) Actual start (RFC 3339). Defaults to the creation timestamp when absent.
projectEnd string (date-time) Actual end (RFC 3339).
externalReference string External reference / foreign system key.
internalReference string Internal reference.
isPublicAccess object Whether the project is visible across the tenant (public access).
isChargable object Whether the project is chargeable.
created string (date-time) Audit override: creation timestamp. Immutable on update — ignored.
createdBy string (masked id)
modified string (date-time) Audit override: modification timestamp to attribute. Defaults to server-now (UTC) when absent.
modifiedBy string (masked id)