API-dokumentation
Tenant-API v1 för system som läser din organisations register och skickar evidens. Sidan genereras från OpenAPI 3.1-specifikationen.
API-version: 1.0.0
Ladda ner OpenAPI-specifikationen (YAML)
Specifikationen och en guide med exempel finns också i produkten under Inställningar > API.
Autentisering och behörigheter
- Basadress: https://<din-domän>/api/v1
- Skicka token som Authorization: Bearer <token>. Token visas en gång när den skapas.
- En token tillhör ett tjänstekonto, en icke-personlig användare som aldrig kan logga in. Den skapas av en superadmin under Inställningar > API.
- Varje token har behörigheter (abilities), ett utgångsdatum (högst 12 månader fram, token utan utgångsdatum nekas) och kan begränsas till IP-adresser eller CIDR-intervall.
- Varje anrop, även nekade, loggas i revisionsloggen (metod, sökväg utan frågesträng, status och adress).
Behörigheter
read:risks, read:assets, read:controls, read:vendors, read:audit, read:kri, read:evidence, write:evidence
Gränser och paginering
- Timgräns per token, som standard 600 anrop. När gränsen är nådd svarar API:t 429 med rubriken Retry-After.
- Listor använder markörbaserad paginering sorterad på updated_at och id. Använd per_page (1 till 200, standard 50) och följ links.next, eller skicka meta.next_cursor som cursor, tills värdet är null.
- filter[updated_after] returnerar rader uppdaterade vid eller efter tidpunkten, för inkrementell synk.
Felformat
Fel har alltid denna form:
{ "success": false, "error": { "code": "validation_failed", "message": "...", "details": { "field": ["..."] } } } 401Token saknas, är okänd eller har gått ut.403Behörighet saknas, token tillhör inte ett tjänstekonto eller adressen är inte tillåten.422Valideringsfel. error.details kopplar fält till meddelanden.429Timgränsen är förbrukad.
Endpoints
| Method | Path | Behörighet | |
|---|---|---|---|
| GET | /api/v1/risks | read:risks | List risks |
| GET | /api/v1/assets | read:assets | List information assets |
| GET | /api/v1/controls | read:controls | List controls of the current statements of applicability with effectiveness |
| GET | /api/v1/vendors | read:vendors | List suppliers |
| GET | /api/v1/findings | read:audit | List audit findings |
| GET | /api/v1/kri | read:kri | List indicators (KRI, KCI, KPI) |
| GET | /api/v1/evidence | read:evidence | List evidence items |
| POST | /api/v1/evidence | write:evidence | Submit evidence for a control |
GET /api/v1/risks
List risks
Behörighet: read:risks · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (20)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | integer | |
| title | string | |
| description | string | |
| category | string | null | |
| risk_type | string | null | |
| status | string | |
| likelihood_inherent | integer | |
| impact_inherent | integer | |
| score_inherent | integer | |
| risk_level | string | |
| likelihood_residual | integer | null | |
| impact_residual | integer | null | |
| score_residual | integer | null | |
| residual_risk_level | string | null | |
| appetite_status | string | null | |
| is_emerging | boolean | |
| owner | object | null | |
| owner_confirmed_at | string | null (date-time) | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
GET /api/v1/assets
List information assets
Behörighet: read:assets · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (19)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | integer | |
| uuid | string | |
| asset_identifier | string | null | |
| name | string | |
| description | string | null | |
| category | string | null | |
| status | string | |
| confidentiality_level | integer | null | |
| integrity_level | integer | null | |
| availability_level | integer | null | |
| overall_classification | integer | null | |
| business_criticality | string | null | |
| is_essential_service | boolean | |
| is_important_service | boolean | |
| owner | object | null | |
| classification_date | string | null (date) | |
| next_review_date | string | null (date) | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
GET /api/v1/controls
List controls of the current statements of applicability with effectiveness
Behörighet: read:controls · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (18)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | integer | |
| soa_document_id | integer | |
| framework | string | null | |
| control_code | string | null | |
| title | string | null | |
| is_applicable | boolean | |
| implementation_status | string | null | |
| is_key_control | boolean | |
| frequency | string | null | |
| design_effectiveness | string | |
| design_assessed_at | string | null (date-time) | |
| operating_effectiveness | string | |
| operating_tested_at | string | null (date-time) | |
| operating_test_period_start | string | null (date) | |
| operating_test_period_end | string | null (date) | |
| verified | boolean | Effective operation counts only with valid evidence and no active exception. |
| excepted | boolean | |
| updated_at | string (date-time) |
GET /api/v1/vendors
List suppliers
Behörighet: read:vendors · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (20)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | integer | |
| name | string | |
| organization_number | string | null | |
| vendor_type | string | null | |
| criticality | string | null | |
| status | string | null | |
| country | string | null | |
| inherent_risk_score | number | null | |
| residual_risk_score | number | null | |
| last_assessed_at | string | null (date-time) | |
| next_assessment_due | string | null (date-time) | |
| contract_start_date | string | null (date) | |
| contract_end_date | string | null (date) | |
| processes_personal_data | boolean | |
| is_ict_provider | boolean | |
| supports_critical_function | boolean | |
| certifications | array | null | |
| owner | object | null | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
GET /api/v1/findings
List audit findings
Behörighet: read:audit · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (18)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | integer | |
| uuid | string | |
| audit_id | integer | |
| finding_type | string | |
| severity | string | |
| status | string | |
| control_id | string | null | |
| title | string | |
| description | string | null | |
| audit_criteria_reference | string | null | |
| corrective_action_required | boolean | |
| due_date | string | null (date) | |
| resolved_at | string | null (date-time) | |
| verified_at | string | null (date-time) | |
| withdrawn_at | string | null (date-time) | |
| assigned_to | object | null | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
GET /api/v1/kri
List indicators (KRI, KCI, KPI)
Behörighet: read:kri · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (19)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | integer | |
| uuid | string | |
| name | string | |
| indicator_type | string | |
| unit | string | null | |
| status | string | |
| measurement_frequency | string | null | |
| threshold_direction | string | null | |
| threshold_green | number | null | |
| threshold_yellow | number | null | |
| threshold_red | number | null | |
| current_value | number | null | |
| current_zone | string | |
| zone_since | string | null (date-time) | |
| days_in_current_zone | integer | null | |
| last_measurement_at | string | null (date-time) | |
| owner | object | null | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
GET /api/v1/evidence
List evidence items
Behörighet: read:evidence · Svarskoder: 200, 401, 403, 422, 429
Parametrar
| Namn | Plats | Typ | Beskrivning |
|---|---|---|---|
| per_page | query | integer | |
| cursor | query | string | The meta.next_cursor of the previous page. |
| filter[updated_after] | query | string (date-time) | Only rows updated at or after this time (inclusive, so the newest updated_at you hold can be passed back; deduplicate on id). |
Svarsfält (data) (18)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | string | |
| control_id | string | null | |
| framework | string | null | |
| title | string | |
| description | string | null | |
| category | string | null | |
| source_type | string | |
| source_system | string | null | |
| external_reference | string | null | |
| sha256 | string | null | |
| status | string | |
| result | string | null | Verdict of an automatic check. The collected data is never returned. |
| has_file | boolean | |
| collected_at | string (date-time) | |
| expires_at | string | null (date-time) | |
| is_expired | boolean | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
POST /api/v1/evidence
Submit evidence for a control
Behörighet: write:evidence · Svarskoder: 200, 201, 401, 403, 422, 429
Begäran (fält) (JSON eller multipart/form-data)
| Fält | Typ | Obligatorisk | Beskrivning |
|---|---|---|---|
| control_id | string | ja | Catalog code of the control. |
| framework | string | ja | Framework label or slug, for example iso27001. |
| source_system | string | ja | |
| collected_at | string (date-time) | ja | Not more than five minutes in the future. |
| title | string | ja | |
| description | string | ||
| category | string | ||
| expires_at | string (date-time) | After collected_at. | |
| external_reference | string | The sending system's own reference; makes retries safe. | |
| data | object | ja | Structured content (at most 1 MiB). Send this or a file. |
Evidens är proveniens, aldrig en deklarerad status: ett anrop kan inte ändra en kontrolls implementations- eller effektivitetsstatus.
Svarsfält (data) (18)
| Fält | Typ | Beskrivning |
|---|---|---|
| id | string | |
| control_id | string | null | |
| framework | string | null | |
| title | string | |
| description | string | null | |
| category | string | null | |
| source_type | string | |
| source_system | string | null | |
| external_reference | string | null | |
| sha256 | string | null | |
| status | string | |
| result | string | null | Verdict of an automatic check. The collected data is never returned. |
| has_file | boolean | |
| collected_at | string (date-time) | |
| expires_at | string | null (date-time) | |
| is_expired | boolean | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
Kontakt för frågor om API:t: info@securapilot.com