Alphasign API ← Docs

API Reference

REST API Alphasign memungkinkan Anda mengintegrasikan tanda tangan digital ke sistem Anda — buat dokumen, kirim undangan TTD, dan verifikasi keaslian secara programmatic.

Base URL

https://alphasign.pastibisa.app/api/v1

Format

JSON (application/json)

Auth

Bearer Token

Authentication

Semua request (kecuali verification) memerlukan API token di header Authorization.

# Include in every request
Authorization: Bearer your_api_token_here

Mendapatkan API Token

  1. Login ke Settings → API
  2. Klik Generate Key
  3. Beri nama (misal: "Backend ERP")
  4. Salin token — hanya ditampilkan sekali

Penting: Jangan expose token di frontend/client-side code. Token hanya untuk server-to-server communication.

Rate Limits

Rate limit per token berdasarkan paket Anda.

PaketPer MenitPer HariPer Bulan
Lontar601,0001,000
Prasasti1205,0005,000
Piagam / Keraton30010,00010,000
Nusantara60020,00020,000

Response Headers

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 298
Retry-After: 45  # only on 429

Errors

{
  "success": false,
  "error": "Human-readable message",
  "errors": { "field": ["validation message"] }
}
CodeMeaning
200Success
201Created
401Invalid/missing token
403Forbidden
404Not found
422Validation failed
429Rate limited

Account

GET/me

Get authenticated user info and tenant.

curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://alphasign.pastibisa.app/api/v1/me
Response 200
{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "John Doe",
    "email": "john@example.com",
    "role": "owner",
    "tenant": { "id": "uuid", "name": "PT Contoh", "plan": "Piagam" }
  }
}
GET/me/quota

Get current quota usage (signatures, documents, storage, API requests).

curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://alphasign.pastibisa.app/api/v1/me/quota
Response 200
{
  "success": true,
  "data": {
    "signatures": { "used": 120, "limit": 500 },
    "documents": { "used": 85, "limit": 500 },
    "storage_bytes": { "used": 5368709120, "limit": 26843545600 },
    "api_requests": { "used": 450, "limit": 10000 }
  }
}

Documents

Kelola dokumen: upload, kirim untuk ditandatangani, dan download hasilnya.

GET/documents

List all your documents (paginated).

Parameters

statusstring, optionalFilter: draft, pending, completed
per_pageinteger, optional1-100, default 20
curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://alphasign.pastibisa.app/api/v1/documents?status=pending&per_page=10"
POST/documents

Upload PDF dan buat dokumen baru. Opsional: tambahkan penandatangan.

Body (multipart/form-data)

title *stringJudul dokumen
file *file (PDF)Max 20MB
signers[]arrayEach: {name, email}
curl -X POST \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "title=Kontrak Kerja" \
  -F "file=@document.pdf" \
  -F "signers[0][name]=John Doe" \
  -F "signers[0][email]=john@example.com" \
  https://alphasign.pastibisa.app/api/v1/documents
GET/documents/{'{id}'}

Get document detail with signers and status.

curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://alphasign.pastibisa.app/api/v1/documents/uuid-here
POST/documents/{'{id}'}/send

Kirim undangan tanda tangan ke semua signers. Mengubah status dari draft → pending.

curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \
  https://alphasign.pastibisa.app/api/v1/documents/uuid/send
GET/documents/{'{id}'}/download

Download signed PDF file.

curl -H "Authorization: Bearer YOUR_TOKEN" \
  -o signed.pdf \
  https://alphasign.pastibisa.app/api/v1/documents/uuid/download
DELETE/documents/{'{id}'}

Hapus dokumen draft. Dokumen pending/completed tidak bisa dihapus.

curl -X DELETE -H "Authorization: Bearer YOUR_TOKEN" \
  https://alphasign.pastibisa.app/api/v1/documents/uuid

Contacts

GET/contacts

List all contacts in your organization.

curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://alphasign.pastibisa.app/api/v1/contacts
POST/contacts

Create a new contact.

Body (JSON)

name *stringNama kontak
email *stringAlamat email
phonestringNomor telepon
companystringNama perusahaan
curl -X POST \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Jane Smith","email":"jane@co.id","company":"PT ABC"}' \
  https://alphasign.pastibisa.app/api/v1/contacts

Verification

PUBLIC

Endpoint ini tidak memerlukan authentication.

GET/verify/{'{hash}'}

Verifikasi keaslian dokumen berdasarkan hash. Bisa dipanggil tanpa token.

curl https://alphasign.pastibisa.app/api/v1/verify/abc123def456
Response 200
{
  "success": true,
  "data": {
    "valid": true,
    "document": { "title": "Kontrak Kerja", "status": "completed" },
    "signers": [{ "name": "John", "signed_at": "2026-06-15T10:00:00Z" }]
  }
}

Code Examples

PHP

$response = Http::withToken('TOKEN')
  ->get('https://alphasign.pastibisa.app/api/v1/me');
$data = $response->json();

Python

import requests
r = requests.get(
  "https://alphasign.pastibisa.app/api/v1/me",
  headers={"Authorization": "Bearer TOKEN"}
)

JavaScript

const res = await fetch(
  `https://alphasign.pastibisa.app/api/v1/me`,
  { headers: { Authorization: `Bearer TOKEN` }}
);