SignaTrust API Documentation

Version 1.0

This API enables seamless integration of SignaTrust's digital signing solutions into any platform with advanced blockchain security and zero-knowledge proof verification.

Base URL

https://api.signatrust.io/v1

1. Authentication & Account Management

Manage user authentication, account linking, and permissions.

1.1 Authenticate User

Authenticate via API key or OAuth.

POST /auth/login

Headers:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request:

{
  "username": "user@example.com",
  "password": "securepassword"
}

Response:

{
  "user_id": "12345",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI...",
  "expires_in": 3600
}

1.2 Link Account

Links a SignaTrust account to an external platform user.

POST /users/link

Request:

{
  "user_id": "12345",
  "external_platform_id": "PLATFORM-98765"
}

Response:

{
  "status": "linked",
  "linked_at": "2025-02-08T10:30:00Z"
}

2. User Management API

Manage user registration and information.

2.1 User Onboarding

POST /users/register

Request:

{
  "email": "user@example.com",
  "full_name": "John Doe",
  "password": "SecurePassword123"
}

Response:

{
  "user_id": "98765",
  "status": "registered",
  "created_at": "2025-03-10T12:34:56Z"
}

2.2 Bulk User Onboarding

POST /users/bulk-register

Request:

{
  "users": [
    {
      "email": "user1@example.com",
      "full_name": "John Doe",
      "password": "SecurePassword123"
    },
    {
      "email": "user2@example.com",
      "full_name": "Jane Smith",
      "password": "AnotherPassword456"
    }
  ]
}

Response:

{
  "success_count": 2,
  "failed_count": 0,
  "users": [
    {
      "user_id": "98765",
      "email": "user1@example.com",
      "status": "registered"
    },
    {
      "user_id": "98766",
      "email": "user2@example.com",
      "status": "registered"
    }
  ],
  "created_at": "2025-03-10T12:34:56Z"
}

2.3 Get User Details

GET /users/{user_id}

Response:

{
  "user_id": "98765",
  "email": "user@example.com",
  "full_name": "John Doe",
  "created_at": "2025-02-08T10:30:00Z",
  "status": "active",
  "verification_status": "verified"
}

3. KYC Verification API

Verify user identity through document uploads.

3.1 Verify Identity

POST /api/kyc/verify

Request:

Form Data:
- selfie: [file]
- idDocument: [file]

Response:

{
  "message": "Verification Successful",
  "selfieHash": "a1b2c3d4e5...",
  "idHash": "f6g7h8i9j0...",
  "timestamp": "2025-03-10T12:34:56Z"
}

3.2 Get KYC Status

GET /api/kyc/status/{user_id}

Response:

{
  "user_id": "12345",
  "status": "verified",
  "verification_level": "full",
  "verified_at": "2025-03-08T15:20:30Z",
  "verification_expiry": "2026-03-08T15:20:30Z",
  "verification_details": {
    "id_verified": true,
    "selfie_verified": true,
    "address_verified": true,
    "blockchain_proof": "0x4a3dc1e28a96cd..."
  }
}

4. Signature Requests

Manage document signing workflows.

4.1 Send Signature Request

POST /signatures

Request:

{
  "signer_email": "user@example.com",
  "document_url": "https://example.com/docs/contract.pdf",
  "redirect_url": "https://example.com/confirmation"
}

Response:

{
  "request_id": "SIGN-001",
  "signing_url": "https://signatrust.com/sign/SIGN-001"
}

4.2 Get Signature Status

GET /signatures/{request_id}

Response:

{
  "request_id": "SIGN-001",
  "status": "pending",
  "signer_email": "user@example.com",
  "signed_at": null
}

4.3 Request Digital Signature

POST /api/signature/request

Request:

{
  "document_id": "DOC-123",
  "user_id": "12345",
  "signature_type": "qualified",
  "blockchain_verification": true
}

Response:

{
  "signature_id": "SIG-456",
  "status": "pending",
  "document_id": "DOC-123",
  "signing_url": "https://signatrust.io/sign/SIG-456",
  "expires_at": "2025-03-17T12:34:56Z"
}

5. Postman & cURL Testing Instructions

Postman Testing

  1. Create a new request: Open Postman and create a new request.
  2. Set the Request URL: For example, to test user authentication, set the URL to:
    https://api.signatrust.io/v1/auth/login
  3. Add Request Headers:
    • Authorization: Bearer YOUR_API_KEY (for endpoints requiring auth)
    • x-api-key: YOUR_API_KEY (for endpoints using API key)
    • Content-Type: application/json
  4. Set the Request Body: Under the Body tab, select "raw" and choose "JSON" as the format. Paste the example JSON. For instance, for login:
    {
      "username": "user@example.com",
      "password": "securepassword"
    }
  5. Send the Request: Click "Send" and verify that the response matches the documentation.

cURL Testing

Below are example cURL commands for testing various endpoints:

Authenticate User

curl --location --request POST 'https://api.signatrust.io/v1/auth/login' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{
    "username": "user@example.com",
    "password": "securepassword"
}'

Get Documents

curl --location --request GET 'https://api.signatrust.io/v1/documents?user_id=12345&limit=20&offset=0' --header 'x-api-key: YOUR_API_KEY' --header 'Content-Type: application/json'

Upload Document

curl --location --request POST 'https://api.signatrust.io/v1/documents/upload' --header 'x-api-key: YOUR_API_KEY' --form 'document=@"/path/to/your/document.pdf"' --form 'title="Employment Contract"' --form 'description="Standard employment contract for new hires"' --form 'user_id="12345"'