Skip to main content

API Introduction

The sajn API allows you to programmatically create, send, and manage digital document signing workflows. Built with modern standards, our REST API provides full TypeScript support and comprehensive documentation.

Base URL

All API requests should be made to:
https://app.sajn.se/api/v1

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:
curl https://app.sajn.se/api/v1/documents \
  -H "Authorization: Bearer YOUR_API_KEY"
Get your API key from Organization Settings > API Keys in the sajn dashboard.

Rate Limits

  • 100 requests per minute per API key
  • 1000 requests per hour per API key
Rate limit headers are included in all responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000

Response Format

All responses are returned in JSON format with appropriate HTTP status codes.

Success Response

{
  "id": "doc_123",
  "name": "Employment Contract",
  "status": "DRAFT",
  "createdAt": "2024-01-15T10:00:00Z"
}

Error Response

{
  "message": "Document not found"
}

HTTP Status Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not Found - Resource doesn’t exist
409Conflict - Resource already exists
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Pagination

List endpoints support pagination with query parameters:
GET /api/v1/documents?page=1&perPage=20
Response includes pagination info:
{
  "documents": [...],
  "totalPages": 5
}

Timestamps

All timestamps are returned in ISO 8601 format with UTC timezone:
{
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T11:45:00Z"
}

Webhooks

Receive real-time notifications about document events. See the Webhooks Guide for details.

SDKs and Tools

  • TypeScript: Full type safety with our OpenAPI specification
  • OpenAPI Spec: Available at /api/v1/openapi
  • Postman: Import our OpenAPI spec into Postman

Support

Need help? Contact us at hej@sajn.se
I