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

Projects

List your projects

GET
/v1/projects

Returns all projects owned by the authenticated user, scoped by RLS to the caller's tenant. The list is unordered; clients should sort by created_at if display order matters.

Authorization

BearerAuth
headerAuthorizationBearer <token>

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

Response Body

Successful Response

application/json
  1. response
[index: integer]?
curl -X GET 'https://api.aisc.sa/v1/projects'
[  {    "created_at": "2019-08-24T14:15:22Z",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string"  }]

Create a project

POST
/v1/projects

Creates a new project (container for uploaded drawings) owned by the authenticated user. The project name must be 1-200 characters. Returns the new project row with its UUID; pass this id to POST /v1/projects/{project_id}/documents to begin uploading drawings.

Authorization

BearerAuth
headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
name*Name
Length1 <= length <= 200

Response Body

Successful Response

application/json
  1. response
created_at*Created At
Formatdate-time
id*Id
Formatuuid
name*Name
curl -X POST 'https://api.aisc.sa/v1/projects' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
{  "created_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string"}
POST
/v1/projects/{project_id}/documents

Mints a presigned S3 PUT URL so the client can upload a drawing file directly to S3 without transiting the API. The returned document_id and upload_url are valid for 15 minutes. After the PUT completes, call POST .../documents/{document_id}/complete to register the document row. Returns 404 if the project is not found or the caller does not own it.

Authorization

BearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

project_id*Project Id
Formatuuid

Request Body

application/json
  1. body
content_md5?string|null
content_type?string|null
original_filename*Original Filename
Length1 <= length <= 300

Response Body

Successful Response

application/json
  1. response
document_id*Document Id
Formatuuid
s3_key*S3 Key
upload_url*Upload Url
curl -X POST 'https://api.aisc.sa/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/documents' \  -H 'Content-Type: application/json' \  -d '{  "original_filename": "string"}'
{  "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",  "s3_key": "string",  "upload_url": "string"}
GET
/v1/projects/{project_id}/documents/{document_id}/artifacts/{name}

Presigned GET URL for a previously stored artifact. 404 when the artifact does not exist (HeadObject), so a caller can probe cheaply and fall back to recomputing.

Authorization

BearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

project_id*Project Id
Formatuuid
document_id*Document Id
Formatuuid
name*Name

Response Body

Successful Response

application/json
  1. response
s3_key*S3 Key
url*Url
curl -X GET 'https://api.aisc.sa/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/artifacts/string'
{  "s3_key": "string",  "url": "string"}
POST
/v1/projects/{project_id}/documents/{document_id}/artifacts/{name}

Mints a presigned S3 PUT URL for a derived artifact (e.g. the viewer projection) stored beside the document. The name should carry the producer's pipeline version (projection.v64.bin) so stale artifacts are never read after an upgrade. 404 when the document is not the caller's.

Authorization

BearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

project_id*Project Id
Formatuuid
document_id*Document Id
Formatuuid
name*Name

Response Body

Successful Response

application/json
  1. response
s3_key*S3 Key
url*Url
curl -X POST 'https://api.aisc.sa/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/artifacts/string'
{  "s3_key": "string",  "url": "string"}
POST
/v1/projects/{project_id}/documents/{document_id}/complete

Verifies that the client's PUT to upload_url succeeded, computes the SHA-256 hash of the uploaded object, enforces the per-user storage quota, and inserts the project_documents row. Idempotent: retrying an already-completed document_id returns the existing row. Returns 409 if the object has not been uploaded yet; 413 if it exceeds the 200 MB limit; 402 if the storage quota or PAYG ceiling is exhausted.

Authorization

BearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

project_id*Project Id
Formatuuid
document_id*Document Id
Formatuuid

Request Body

application/json
  1. body
original_filename*Original Filename
Length1 <= length <= 300

Response Body

Successful Response

application/json
  1. response
document_id*Document Id
Formatuuid
file_hash*File Hash
original_filename*Original Filename
s3_key*S3 Key
size_bytes*Size Bytes
curl -X POST 'https://api.aisc.sa/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/complete' \  -H 'Content-Type: application/json' \  -d '{  "original_filename": "string"}'
{  "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",  "file_hash": "string",  "original_filename": "string",  "s3_key": "string",  "size_bytes": 0}