Visena Dokumentasjon
Partner API

Ressurs

Company template

Skrivebeskyttede maler som klassifiserer selskaper. List og hent. Referer malen fra forespørselskropper for oppretting og oppdatering av selskap.

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.

En company template er den navngitte klassifiseringen et selskap opprettes under, og den bærer med seg politikken som følger klassifiseringen: om selskaper opprettet fra den settes under overvåking, om de risikovurderes, om de tilgangsstyres i stedet for å være åpne, og om det å opprette ett også oppretter et prosjekt og videresender dit. Én av malene er standardmalen for instansen. Over API-et er de skrivebeskyttet — du lister dem og leser én, og refererer så den du vil bruke fra en forespørselskropp for oppretting eller oppdatering av selskap; selve malen vedlikeholdes i Visena, ikke her.

Endepunkter

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

List company templates (offset-paginated)

GET /{instanceName}/api/v1/{locale}/company-template

Offset/limit paging with a real total. Ordered by name ascending, case-insensitively — the order is fixed and cannot be selected, because name is the only orderable field upstream. Optional filters: isActive, shouldBeMonitored; no other filter and no name search is available. The items carry the template's own attributes only: the company-type, business-field, project-template and access-control associations are deliberately excluded, so that a paged read has a bounded query count. 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.
shouldBeMonitored query boolean

Svar

Status Beskrivelse
200 A page of company templates with totals and navigation links.
CompanyTemplateOffsetListResponse · application/json
400 Invalid paging parameter.

Eksempel

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

Get a company template

GET /{instanceName}/api/v1/{locale}/company-template/{templateId}

Returns the template's own attributes. The company-type, business-field, project-template and access-control associations are deliberately excluded, as is the company count, which is a list-only figure and not an attribute of the template. 404 if unknown; 400 if the id cannot be unmasked.

Parametere

Parameter Plassering Type Beskrivelse
templateId required path string Masked template id.

Svar

Status Beskrivelse
200 The company template.
CompanyTemplateDto · application/json
400 The id is not a valid id.
404 No company template with that id.

Eksempel

curl
curl "https://api.visena.example/acme/api/v1/en/company-template/tM2qL6" \
  -H "Authorization: Bearer $TOKEN"

Objektstrukturer

Svarkroppene som brukes over, i den rekkefølgen de først refereres. Ingen av endepunktene tar en forespørselskropp.

CompanyTemplateOffsetListResponse

Felt Type Beskrivelse
totalItems integer Total number of matching company templates.
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 CompanyTemplateListItemDto The company templates on this page, ordered by name.
links CompanyTemplateListLinks

CompanyTemplateListItemDto

The company templates on this page, ordered by name.

Felt Type Beskrivelse
id string (masked id)
name string
code string Short code of the company template.
description string Free-text description, if any.
isActive boolean
shouldBeMonitored boolean Whether companies created from this template are placed under monitoring. A policy flag, not an observed state.
isDefault boolean Whether this is the tenant's default company template.
isDefaultPublicAccess boolean Whether companies created from this template are access-controlled rather than public. Derived as the negation of the template's default-public-access flag; it does not consult the template's access-control member list, so a template can report false while holding one.
isSystemType boolean Whether this is a system template.
numCompanies integer Number of companies using this template. NOT access-filtered: it counts companies the caller may not itself be permitted to see. A bare count carries no company identity.

RFC 8288 navigation links.

Felt Type Beskrivelse
self string URL of the current page.
first string URL of the first page.
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.

CompanyTemplateDto

Felt Type Beskrivelse
id string (masked id)
name string
code string Short code of the company template.
description string Free-text description, if any.
isActive boolean
isDefault boolean Whether this is the tenant's default company template.
shouldBeMonitored boolean Whether companies created from this template are placed under monitoring. A policy flag, not an observed state.
shouldBeRiskAssessed boolean Whether companies created from this template are risk-assessed. Only meaningful when the template also monitors.
redirectToProjectAfterCreate boolean Whether creating a company from this template redirects to the project it also creates.
isDefaultPublicAccess boolean Whether companies created from this template are access-controlled rather than public. Derived as the negation of the template's default-public-access flag; it does not consult the template's access-control member list, so a template can report false while holding one.
isSystemType boolean Whether this is a system template.