Skip to content

API Overview

GSign RESTful API documentation.

Base URL

Production: https://api.gesign.mn/api/v1
Development: http://localhost:3000/api/v1

Authentication

All API requests require authentication via JWT token or API key.

JWT Token (User Sessions)

http
Authorization: Bearer <token>

API Key (Server-to-Server)

http
X-API-Key: <api_key>

Response Format

Success Response

json
{
  "success": true,
  "data": {
    // Response data
  },
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 100
  }
}

Error Response

json
{
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Human readable error message",
    "details": {}
  }
}

HTTP Status Codes

CodeDescription
200OK
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Unprocessable Entity
429Too Many Requests
500Internal Server Error

Rate Limiting

TierRate Limit
Free100 requests/hour
Paid1,000 requests/hour
EnterpriseCustom

Rate limit headers:

http
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200

Pagination

Cursor-based pagination:

http
GET /api/v1/documents?limit=20&cursor=abc123

Response:

json
{
  "success": true,
  "data": [...],
  "meta": {
    "limit": 20,
    "has_more": true,
    "next_cursor": "def456"
  }
}

API Endpoints

Authentication

  • POST /auth/register - Register new user
  • POST /auth/login - Login
  • POST /auth/refresh - Refresh token
  • POST /auth/logout - Logout
  • GET /auth/me - Get current user

Documents

  • GET /documents - List documents
  • POST /documents - Upload document
  • GET /documents/:id - Get document
  • PUT /documents/:id - Update document
  • DELETE /documents/:id - Delete document
  • GET /documents/:id/download - Download document

Envelopes

  • GET /envelopes - List envelopes
  • POST /envelopes - Create envelope
  • GET /envelopes/:id - Get envelope
  • PUT /envelopes/:id - Update envelope
  • DELETE /envelopes/:id - Delete envelope
  • POST /envelopes/:id/send - Send envelope
  • POST /envelopes/:id/void - Void envelope

Certificates

  • GET /certificates - List certificates
  • POST /certificates/generate - Generate certificate
  • POST /certificates/import - Import certificate
  • GET /certificates/:id - Get certificate
  • PUT /certificates/:id - Update certificate
  • DELETE /certificates/:id - Delete certificate
  • POST /certificates/:id/sign - Sign with certificate
  • POST /certificates/:id/validate - Validate certificate

Webhooks

  • GET /webhooks - List webhooks
  • POST /webhooks - Create webhook
  • GET /webhooks/:id - Get webhook
  • PUT /webhooks/:id - Update webhook
  • DELETE /webhooks/:id - Delete webhook

Webhook Events

EventDescription
envelope_sentEnvelope was sent to recipients
envelope_deliveredEnvelope was delivered
recipient_signedA recipient signed
envelope_completedAll recipients signed
envelope_declinedEnvelope was declined
envelope_voidedEnvelope was voided
certificate_generatedCertificate was generated
certificate_expiredCertificate expired

Health Check

http
GET /health

Response:

json
{
  "status": "ok",
  "version": "1.0.0"
}

GSign Digital Signature Platform