POST /sign

Request biometric signatures for documents, terms, and legal agreements.

Endpoint

POST https://sign.api.uip.id/v1

Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Body

{
  "webhook_url": "https://yourapp.com/webhooks/uip/sign",
  "document_title": "Terms of Service v2.1",
  "document_content": "By using our service, you agree to...",
  "metadata": {
    "version": "2.1",
    "user_ip": "192.168.1.1"
  }
}

Parameters

ParameterTypeRequiredDescription
webhook_urlstringYesURL to receive signing results
document_titlestringYesTitle/name of what the user is signing
document_contentstringYesFull text content that the user will sign
metadataobjectNoAdditional data to associate with the signature

Response

{
  "session_id": "sign_sess_1234567890abcdef",
  "qr_data": "uip://sign/sign_sess_1234567890abcdef",
  "mobile": false,
  "qr_image_url": "https://qr.uip.id/sign_sess_1234567890abcdef.png",
  "expires_in": 300,
  "document_hash": "sha256:a1b2c3d4e5f6..."
}

Code Implementation

// JavaScript
async function requestSignature(title, content, metadata = {}) {
  const response = await fetch('https://sign.api.uip.id/v1', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ' + YOUR_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      webhook_url: 'https://yourapp.com/webhooks/uip/sign',
      document_title: title,
      document_content: content,
      metadata: metadata
    })
  });

  const data = await response.json();
  
  if (data.mobile) {
    window.location.href = data.qr_data;
  } else {
    document.getElementById('qr-container').innerHTML = 
      'UIP Sign QR';
  }
  
  return data.session_id;
}

// Usage
requestSignature(
  'Terms of Service v2.1',
  'By using our service, you agree to...',
  { version: '2.1', user_ip: getUserIP() }
);

Webhook Response

{
  "event": "signature_completed",
  "session_id": "sign_sess_1234567890abcdef",
  "status": "success",
  "signature_data": {
    "uip_id": "uip_user_9876543210",
    "document_title": "Terms of Service v2.1",
    "document_hash": "sha256:a1b2c3d4e5f6...",
    "signature": "uip_sig_abc123def456...",
    "task_hash": "task_a1b2c3d4e5f6789012345678901234567890abcdef",
    "signed_at": "2024-01-15T10:35:00Z",
    "signer_info": {
      "full_name": "Alice Johnson",
      "verification_level": "government_id"
    }
  },
  "metadata": {
    "version": "2.1",
    "user_ip": "192.168.1.1"
  },
  "timestamp": "2024-01-15T10:35:00Z"
}