Skip to main content
POST
/
api
/
signing
/
request
Create Signature Request
curl --request POST \
  --url https://api.example.com/api/signing/request \
  --header 'Content-Type: application/json' \
  --data '
{
  "clientId": "<string>",
  "clientSecret": "<string>",
  "identityId": "<string>",
  "payload": "<string>",
  "metadata": {},
  "expiresInSeconds": 123
}
'
{
  "requestId": "<string>",
  "expiresAt": "<string>",
  "publicKey": "<string>",
  "error": "<string>"
}

Authentication

This endpoint requires OAuth app credentials (client ID and client secret). The credentials are passed in the request body.

Request Body

clientId
string
required
Your OAuth app’s client ID
clientSecret
string
required
Your OAuth app’s client secret
identityId
string
required
The UUID of the identity that should sign the payload
payload
string
required
The message/data to be signed. Maximum 10,000 characters.
metadata
object
Optional metadata to attach to the signature request for your own reference
expiresInSeconds
number
default:"300"
How long the request is valid for, in seconds. Minimum: 60, Maximum: 3600 (1 hour), Default: 300 (5 minutes)

Response

requestId
string
Unique identifier for this signature request. Use this to poll for status.
expiresAt
string
ISO 8601 timestamp when this request expires
publicKey
string
The public key for the identity that will be used to verify the signature

Code Example

import { createSignatureRequest } from "ave-sdk";

const config = {
  clientId: "your_client_id",
  clientSecret: "your_client_secret",
  issuer: "https://aveid.net", // optional
};

// Create a signature request
const request = await createSignatureRequest(config, {
  identityId: "user-identity-uuid",
  payload: "Sign this message to authenticate",
  metadata: { action: "login", timestamp: Date.now() },
  expiresInSeconds: 300, // 5 minutes
});

console.log("Request ID:", request.requestId);
console.log("Public Key:", request.publicKey);
console.log("Expires at:", request.expiresAt);

Workflow

  1. Call this endpoint to create a signature request
  2. Redirect the user to Ave to sign: https://aveid.net/sign?requestId={requestId}
  3. Poll the status endpoint to check if the user has signed
  4. Once signed, verify the signature using the verify endpoint

Error Responses

error
string
Error message describing what went wrong

Common Errors

  • 401 Unauthorized - Invalid client_id or client_secret
  • 404 Not Found - Identity not found
  • 400 Bad Request - Identity does not have a signing key
  • 400 Bad Request - Payload exceeds maximum length (10KB)

Build docs developers (and LLMs) love