Overview
Issuers are trusted users who can grant and revoke credentials to improvers. Credentials gate access to workflow steps requiring specific qualifications.Authentication
All endpoints use thewithIssuer middleware which:
- Requires a valid JWT token with
userDidin context - Checks if user has issuer role via
IsIssuer() - Admin users automatically bypass role checks
Request Issuer Status
POST /issuers/request
Request issuer status for authenticated user. Request Body- Admin approves issuer via
PUT /admin/issuer-requests - Admin sets credential scopes via
PUT /admin/issuers - Issuer can now grant/revoke those credential types
400: Missing fields, invalid email, or email not verified409: User already has approved issuer status
Issuer Scopes
GET /issuers/scopes
Get authenticated issuer’s credential scopes. Response: 200 OKCredential Requests
GET /issuers/credential-requests
Get credential requests for credentials this issuer can grant. Query Parameterssearch: Filter by user name/emailpage: Page number (0-indexed)count: Results per page (default: 20)
- Only shows requests for credential types in issuer’s scopes
- Pending requests appear first
403: User does not have issuer role
POST /issuers/credential-requests//decision
Approve or deny a credential request. Request Body- If approved: Creates active credential for the user
- Credential is effective immediately
- User can now claim workflow steps requiring this credential
400: Invalid decision, required fields missing403: Issuer not allowed to grant this credential type404: Request not found409: Pending credential request already exists for this user/type
Direct Credential Management
POST /issuers/credentials
Grant a credential directly to a user (bypassing request flow). Request Body400: Invalid credential type, missing user_id403: Issuer not allowed to grant this credential type404: User or credential type not found
DELETE /issuers/credentials
Revoke a credential from a user. Request Body- Credential is marked as revoked (soft delete)
- User can no longer claim workflow steps requiring this credential
- Does NOT unclaim existing step assignments
400: Invalid credential type, missing user_id403: Issuer not allowed to revoke this credential type404: Credential not found or already revoked
GET /issuers/credentials/
Get all credentials for a specific user. Response: 200 OKUser Lookup
GET /issuers/users/by-address/
Lookup user by Ethereum address (useful for granting credentials based on wallet address). Response: 200 OK404: User not found with this address
Credential System Overview
Default Credential Types
- dpw_certified: Department of Public Works certification
- sfluv_verifier: SFLUV platform verifier credential
POST /admin/credential-types.
Credential Workflow
Scope Enforcement
Issuers can only grant/revoke credentials in theirallowed_credentials list:
- Set by admin via
PUT /admin/issuers - Admin users can grant any credential
- Attempting to grant out-of-scope credential returns
403
Credential Effects
Credentials control access to workflow steps:- Workflow roles specify
required_credentials: ["dpw_certified"] - Improvers must have ALL required credentials to claim a step
- Missing credentials returns
403on claim attempts - Credential checks run at claim time (not at workflow viewing time)
Email Notifications
Credential requests trigger email notifications:- On request creation: Emails all issuers with scopes matching the requested credential
- Email includes: requester name, email, credential type, request ID, timestamp
- Issuer email addresses come from their issuer profile
Notes
- Credentials are granted at the user level (not per-workflow)
- Active credentials persist across workflows
- Revoking a credential does not unclaim existing step assignments
- Credential history is preserved (grants and revocations are logged)
- Admins bypass all credential scope restrictions