Visena Dokumentasjon
Partner API

Ressurs

Activity

Oppgaver og avtaler på et prosjekt — postene bak «Aktiviteter»-skjermen i origo. Full CRUD; sletting lukker aktiviteten som standard og kan i stedet fjerne den permanent.

En aktivitet er én arbeidsenhet på et prosjekt: et navn og en fritekstbeskrivelse, en ansvarlig person, en status, en frist, timeanslag og klassifiseringene for type, prioritet, alvorlighet og løsning som prosjektets mal tilbyr. Hver aktivitet hører til nøyaktig ett prosjekt — projectId er påkrevd både når du oppretter en aktivitet og når du erstatter den. Legg merke til hva strukturen ikke inneholder: det finnes ingen start- eller sluttid, og ingen felt for tid som faktisk er brukt. estimate og etc (estimate to complete) er anslag framover, og dueDate er en ren lokal dato, så en aktivitet er selve oppgave- eller avtaleposten og ikke en timeføring.

Status kan ikke skrives gjennom noe endepunkt på denne siden: en ny aktivitet starter på prosjektets standardstatus, og verken en full erstatning eller en merge-patch kan flytte den.

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 an activity

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

Creates an activity on a project and returns the full entity. The activity starts at its project's default status — status is not writable here. 201 with a Location header.

Forespørselskropp

application/jsonActivityCreateDto

Svar

Status Beskrivelse
201 Activity created.
ActivityResponseDto · application/json
400 Request body failed validation (name or projectId missing).
422 A referenced entity (project, phase, responsible person) does not exist, or a classification ref is not available on the project's template.

Eksempel

curl
curl -X POST "https://api.visena.example/acme/api/v1/en/activity" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Kickoff meeting",
    "projectId": "pJ7wN2",
    "dueDate": "2026-09-15"
  }'

Get an activity

GET /{instanceName}/api/v1/{locale}/activity/{activityId}

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

Parametere

Parameter Plassering Type Beskrivelse
activityId required path string Masked activity id.

Svar

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

Eksempel

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

List activities

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

Offset-paginated list with a real total. Filter by project, company, responsible person, status, open/closed, free-text query and a due-date upper bound; sort by created, modified, name or dueDate.

Parametere

Parameter Plassering Type Beskrivelse
offset query integer
default 0
Zero-based item offset.
limit query integer Maximum items to return per page.
projectId query string Masked project id.
companyId query string Masked company id.
responsibleId query string Masked id of the responsible person.
statusId query string Masked status id.
isActive query boolean Filter on active state.
query query string Free-text filter; the endpoint description lists the fields it matches.
dueBefore query string (date) Due-date upper bound (ISO-8601 date).
sort query string Sort key; the endpoint description lists the allowed values.

Svar

Status Beskrivelse
200 A page of activities.
ActivityOffsetListResponse · application/json
400 limit out of range, unknown sort, or an id that is not a valid id.

Eksempel

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

List activities by cursor

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

Keyset-paginated list over the activity id. No total is returned. Pass the opaque cursor from a previous page to continue; the same filters as the offset list apply.

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.
projectId query string Masked project id.
companyId query string Masked company id.
responsibleId query string Masked id of the responsible person.
statusId query string Masked status id.
isActive query boolean Filter on active state.
query query string Free-text filter; the endpoint description lists the fields it matches.
dueBefore query string (date) Due-date upper bound (ISO-8601 date).

Svar

Status Beskrivelse
200 A page of activities.
ActivityCursorListResponse · application/json
400 Invalid or expired cursor, limit out of range, or an id that is not a valid id.

Eksempel

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

Før du bygger en synkronisering på cursor- eller timeline-modusen, les synkroniseringssemantikken deres: hvilken av de to som gir ett konsistent uttrekk som må gås gjennom i én omgang, hvilken du gjenopptar fra, hvorfor levering er minst-én-gang slik at du må fjerne duplikater på id, og hva ingen av dem sier om rader som forsvinner. Alt dette er dokumentert én gang, for alle ressurser, under Lister, paginering og synk.

List activities by change time

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

Keyset-paginated change feed ordered by last modification (falling back to creation), from an optional since lower bound. No total is returned.

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.
projectId query string Masked project id.
companyId query string Masked company id.
responsibleId query string Masked id of the responsible person.
statusId query string Masked status id.
isActive query boolean Filter on active state.
query query string Free-text filter; the endpoint description lists the fields it matches.
dueBefore query string (date) Due-date upper bound (ISO-8601 date).

Svar

Status Beskrivelse
200 A page of activities.
ActivityCursorListResponse · application/json
400 Invalid or expired cursor, malformed since, limit out of range, or an id that is not a valid id.

Eksempel

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

Replace an activity

PUT /{instanceName}/api/v1/{locale}/activity/{activityId}

Full replace: an omitted optional field is cleared, except typeId, priorityId, severityId, resolutionId and the two boolean flags — those are non-nullable on the entity, so omitting one keeps its current value. status is not writable — use the status transition endpoint.

Parametere

Parameter Plassering Type Beskrivelse
activityId required path string Masked activity id.

Forespørselskropp

application/jsonActivityUpdateDto

Svar

Status Beskrivelse
200 The updated activity.
ActivityResponseDto · application/json
400 Request body failed validation.
404 No activity with that id.
422 A referenced entity does not exist, or a classification ref is not available on the project's template.

Eksempel

curl
curl -X PUT "https://api.visena.example/acme/api/v1/en/activity/aT4cV9" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Kickoff meeting",
    "projectId": "pJ7wN2",
    "dueDate": "2026-09-22"
  }'

Partially update an activity

PATCH /{instanceName}/api/v1/{locale}/activity/{activityId}

RFC 7396 JSON Merge Patch (application/merge-patch+json). Omit a key to leave it unchanged, send null to clear it. An empty body {} is a no-op. status is not patchable — use the status transition endpoint.

Parametere

Parameter Plassering Type Beskrivelse
activityId required path string Masked activity id.

Forespørselskropp

application/merge-patch+jsonobject

Svar

Status Beskrivelse
200 The updated activity.
ActivityResponseDto · application/json
400 A field value could not be parsed, or a non-nullable field was cleared.
404 No activity with that id.
415 Content-Type is not application/merge-patch+json.
422 A referenced entity does not exist, or a classification ref is not available on the project's template.

Eksempel

curl
curl -X PATCH "https://api.visena.example/acme/api/v1/en/activity/aT4cV9" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{
    "dueDate": "2026-09-22",
    "responsiblePersonId": "xK9mQ2"
  }'

Close or delete an activity

DELETE /{instanceName}/api/v1/{locale}/activity/{activityId}

mode=close (default) closes the activity through Visena's quick-close, which is reversible. mode=delete removes it permanently. Any other mode is a 400.

Parametere

Parameter Plassering Type Beskrivelse
activityId required path string Masked activity id.
mode query string
default close
Delete mode; the endpoint description explains the options and the default.

Svar

Status Beskrivelse
204 Activity closed or deleted.
400 Unknown mode, or the id is not a valid id.
404 No activity with that id.

Eksempel

curl
curl -X DELETE "https://api.visena.example/acme/api/v1/en/activity/aT4cV9?mode=close" \
  -H "Authorization: Bearer $TOKEN"

Objektstrukturer

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

ActivityCreateDto

Felt Type Beskrivelse
name required string Activity name.
projectId required string (masked id)
description string Free-text description.
projectPhaseId string (masked id)
responsiblePersonId string (masked id)
typeId string (masked id)
priorityId string (masked id)
severityId string (masked id)
resolutionId string (masked id)
dueDate string (date) Due date (ISO-8601 local date).
estimate object Estimated hours.
etc object Estimate to complete, in hours.
sortIndex object Manual ordering index within the project.
externalReference string Caller-owned external reference.
includeInAssignmentAgreement object Include this activity in the assignment agreement.
productTxRequiredWhenDone object Require a product transaction before the activity can be closed.

ActivityResponseDto

Felt Type Beskrivelse
id string (masked id)
name string Activity name.
description string Free-text description.
project ActivityRefDto
projectPhase ActivityRefDto
responsible ActivityRefDto
status ActivityRefDto
type ActivityRefDto
priority ActivityRefDto
severity ActivityRefDto
resolution ActivityRefDto
dueDate string (date) Due date.
estimate object Estimated hours.
etc object Estimate to complete, in hours.
sortIndex object Manual ordering index within the project.
externalReference string Caller-owned external reference.
includeInAssignmentAgreement boolean Included in the assignment agreement.
productTxRequiredWhenDone boolean A product transaction is required before the activity can be closed.
created read-only string (date-time) Creation timestamp (UTC).
createdBy ActivityRefDto
modified read-only string (date-time) Last modification timestamp (UTC).
modifiedBy ActivityRefDto
actedBy string (masked id)

ActivityRefDto

Priority.

Felt Type Beskrivelse
id string (masked id)
name string Display name of the referenced entity.

ActivityOffsetListResponse

Felt Type Beskrivelse
totalItems integer Total number of activities matching the filters.
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 ActivityListItemDto The activities on this page.
links ActivityListLinks

ActivityListItemDto

The activities on this page, always in ascending order.

Felt Type Beskrivelse
id string (masked id)
name string Activity name.
description string Free-text description.
project ActivityRefDto
company CompanyRefDto
responsible string (masked id)
status ActivityRefDto
priority ActivityRefDto
dueDate string (date) Due date.
estimate object Estimated hours.
etc object Estimate to complete, in hours.
sortIndex object Manual ordering index within the project.
created string (date-time) Creation timestamp (UTC).
modified string (date-time) Last modification timestamp (UTC).

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".

Navigation links for this page.

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).

ActivityCursorListResponse

Felt Type Beskrivelse
items array of ActivityListItemDto The activities on this page, always in ascending order.
nextCursor string Opaque cursor for the next page, if more rows follow.
prevCursor string Opaque cursor for the previous page, if any.
links ActivityListLinks

ActivityUpdateDto

Felt Type Beskrivelse
name required string Activity name.
projectId required string (masked id)
description string Free-text description. Omit to clear.
projectPhaseId string (masked id)
responsiblePersonId string (masked id)
typeId string (masked id)
priorityId string (masked id)
severityId string (masked id)
resolutionId string (masked id)
dueDate string (date) Due date (ISO-8601 local date). Omit to clear.
estimate object Estimated hours. Omit to clear.
etc object Estimate to complete, in hours. Omit to clear.
sortIndex object Manual ordering index. Omit to clear.
externalReference string Caller-owned external reference. Omit to clear.
includeInAssignmentAgreement object Include this activity in the assignment agreement. Omit to keep the current value.
productTxRequiredWhenDone object Require a product transaction before close. Omit to keep the current value.