امتثال
واجهة البرمجة

Compliance

POST
/v1/compliance/approvals

Append one approval and return it.

A failure here is answered with 503, never a cheerful 2xx: the engineer has to know their sign-off was not recorded. Reporting success for a record that did not persist is the exact failure this ledger exists to prevent.

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Request Body

application/json
  1. body
approved_by*Approved By

The reviewer's identity as shown to them. An approval nobody signed is not an approval.

Length1 <= length <= 320
drawing_sha256*Drawing Sha256

The content-addressed drawing hash the approval is about.

Match^[a-f0-9]{64}$
Length64 <= length <= 64
organisation_id?|

Set for org-paid workspaces so colleagues can read the record.

patch_ids*array<string>

The proposed fixes the engineer accepted. Never empty — an approval of nothing is not a judgement, and the database CHECK rejects it too.

Items1 <= items
revokes_id?|

The approval this one supersedes. The ledger is append-only; a correction is a new row.

Response Body

Successful Response

application/json
  1. response
approved_at*Approved At
Formatdate-time
approved_by*Approved By
drawing_sha256*Drawing Sha256
id*Id
Formatuuid
patch_ids*array<string>
revokes_id*|null
curl -X POST 'https://api.aisc.sa/v1/compliance/approvals' \  -H 'Content-Type: application/json' \  -d '{  "approved_by": "string",  "drawing_sha256": "stringstringstringstringstringstringstringstringstringstringstri",  "patch_ids": [    "string"  ]}'
{  "approved_at": "2019-08-24T14:15:22Z",  "approved_by": "string",  "drawing_sha256": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "patch_ids": [    "string"  ],  "revokes_id": "5ee1678e-5453-40a5-9986-afa80c46f7b9"}
GET
/v1/compliance/approvals/{drawing_sha256}

The whole chain, not a computed current state.

A revocation only means something next to what it revoked, and an audit seven years from now needs the sequence a human actually produced.

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Path Parameters

drawing_sha256*Drawing Sha256

Response Body

Successful Response

application/json
  1. response
[index: integer]?
curl -X GET 'https://api.aisc.sa/v1/compliance/approvals/string'
[  {    "approved_at": "2019-08-24T14:15:22Z",    "approved_by": "string",    "drawing_sha256": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "patch_ids": [      "string"    ],    "revokes_id": "5ee1678e-5453-40a5-9986-afa80c46f7b9"  }]