For most backend integrations, you should use a service account instead. Service accounts are independent machine identities, not tied to any user. Use a PAT only when you specifically need to act as a particular user.
When to use a PAT
PATs are for cases where the action must be attributed to a specific user: your server performs operations in a user’s wallet while maintaining their identity as the actor. This is the recommended approach over registering a server-controlled credential on the user’s account. You can also create reduced-permissions tokens representing the user (e.g.: read-only) for automating without reducing the user’s own permissions.PAT vs service account
| PAT | Service account | |
|---|---|---|
| Identity | Tied to a user | Independent machine identity |
| Permissions | Intersection of user and token permissions | Independent permissions |
| Lifecycle | Stops working when user is deactivated | Independent |
| Expiration | Optional | Optional |
| Use case | Acting on behalf of a user | Server-to-server automation |
Create a PAT
Generate a keypair
Your PAT needs its own keypair for signing API requests. Generate one using OpenSSL:See Generate a key pair for other algorithms and platforms.
Create the PAT in the dashboard
- Navigate to Settings > Developers > Personal Access Tokens (direct link: https://app.dfns.io/settings/developers/personal-access-tokens)
- Click New Personal Access Token
- Enter a name (e.g., “Wallet Monitor” or “Backend Automation”)
- Paste the contents of your public key file (including the
-----BEGIN PUBLIC KEY-----and-----END PUBLIC KEY-----lines) - Optionally set an expiration
- Click Create and sign with your passkey
Creating a PAT requires the
Auth:Pats:Create permission.Save the token and credential ID
After creation, you receive:
- Access token — used in the
Authorization: Bearer <token>header - Credential ID (
cr-...) — used to configure the SDK signer
Assign permissions (optional)
By default, a PAT can do anything the linked user can do. You can restrict it by assigning a role with fewer permissions.The effective permissions on every request are the intersection of the user’s permissions and the token’s permissions. This means:
- Reducing the user’s permissions immediately restricts all their PATs
- A PAT can never exceed the user’s current permissions, even if the token’s own role is broader
Using your PAT
Configure the SDK with your PAT’s access token and the private key you generated in step 1. The setup is identical to a service account, just with the PAT credentials instead.Lifecycle management
PATs can be deactivated, reactivated, and deleted through the dashboard or API. If the linked user is deactivated, all their PATs stop working. The PAT records themselves are not deleted, so reactivating the user restores PAT access. To rotate the signing keypair without replacing the PAT itself, see Rotating credentials.Related
Generate a key pair
Supported algorithms and generation examples
Signing requests
How API request signing works
Permissions reference
Full list of available permissions
PAT API reference
API endpoints and object schema
