Seal Docs

Authentication

Learn how to authenticate API requests using Clerk API keys with scope-based access control

Authentication

The Seal API uses Clerk API keys for authentication. All API requests must include a valid API key in the Authorization header.

Creating an API Key

API keys are created through the Clerk Dashboard:

  1. Navigate to your Clerk Dashboard
  2. Go to API Keys section
  3. Click Create API Key
  4. Select the required scopes for your integration
  5. Copy the generated API key (format: ak_xxx)

Security Best Practice: Store API keys securely and never commit them to version control. Rotate keys regularly and use environment variables in production.

API Scopes

Seal uses scope-based access control to limit what each API key can do. Select only the scopes your integration needs:

ScopeDescriptionEndpoints
seal:documents:readRead document metadata and contentGET /documents, GET /documents/:id, GET /documents/:id/download
seal:documents:writeCreate, update, delete documentsPOST /documents, PATCH /documents/:id, DELETE /documents/:id, POST /documents/:id/send, POST /documents/:id/void
seal:templates:readRead template metadata and fieldsGET /templates, GET /templates/:id, GET /templates/:id/fields
seal:templates:writeCreate, update, delete templatesPOST /templates, PATCH /templates/:id, DELETE /templates/:id
seal:recipients:readRead recipient informationGET /documents/:id/recipients, GET /recipients/:id
seal:recipients:writeManage document recipientsPOST /documents/:id/recipients, PATCH /recipients/:id, DELETE /recipients/:id, POST /recipients/:id/remind
seal:signatures:readRead signature data and audit trailsGET /signatures, GET /signatures/:id, GET /signatures/:id/verify, GET /signatures/:id/audit

Making Authenticated Requests

Include your API key in the Authorization header using the Bearer scheme:

TypeScript Example

const response = await fetch("https://seal.convex.site/api/v1/documents", {
  method: "GET",
  headers: {
    Authorization: "Bearer ak_your_api_key_here",
    "Content-Type": "application/json",
  },
});

if (!response.ok) {
  const error = await response.json();
  console.error("API Error:", error);
  throw new Error(error.detail);
}

const documents = await response.json();
console.log("Documents:", documents);

cURL Example

curl -X GET https://seal.convex.site/api/v1/documents \
  -H "Authorization: Bearer ak_your_api_key_here" \
  -H "Content-Type: application/json"

Authentication Errors

Status CodeErrorDescription
401MISSING_AUTH_HEADERNo Authorization header provided
401INVALID_AUTH_FORMATAuthorization header format is incorrect
401INVALID_API_KEYAPI key is invalid or expired
403INSUFFICIENT_SCOPEAPI key lacks required scope for this endpoint
403ORGANIZATION_ACCESS_DENIEDUser has no active organization

Best Practices

Scope Principle of Least Privilege: Only request the minimum scopes needed for your integration. For example, if you only need to read documents, use seal:documents:read instead of seal:documents:write.

  • Use HTTPS: Always make requests over HTTPS to protect your API key in transit
  • Rotate Keys: Regularly rotate API keys, especially if they may have been compromised
  • Environment Variables: Store API keys in environment variables, never hardcode them
  • Monitor Usage: Track API key usage in the Clerk Dashboard to detect anomalies
  • Separate Keys: Use different API keys for development, staging, and production environments

Next Steps

Now that you understand authentication, check out the Quick Start guide to send your first document for signing.

Last updated on

On this page