Account
The signed-in user and the workspaces they belong to.
Current user#
The signed-in user, their active workspace and effective permissions.
/api/meAny signed-in person.
Needs a signed-in person: API keys can't call this.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/me" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"user": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Ada Lovelace","email": "ada@example.com","image": null,"createdAt": "2026-10-01T12:00:00.000Z","lastLoginAt": "2026-10-01T12:00:00.000Z"},"organization": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","slug": "invoices","isPersonal": false},"roleKey": "roleKey","permissions": ["documents:read","documents:create","queues:read"]}
Update your display name#
Update your display name
/api/meAny signed-in person.
Needs a signed-in person: API keys can't call this.
Body
application/jsonnamestringrequired
Responses
OK
curl -X PATCH "https://docuflow.pendral.io/api/me" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION" \-H "Content-Type: application/json" \-d '{"name": "Invoices"}'
{"user": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Ada Lovelace"}}
Your sessions#
Where you are signed in: recent sessions with device, IP and last activity, which are still live, and which one is this browser.
/api/me/sessionsAny signed-in person.
Needs a signed-in person: API keys can't call this.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/me/sessions" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"sessions": [{"id": "clx9k2m4p0001qh8z3v7d5f2a","active": true,"current": false,"lastSeenAt": "2026-10-01T12:00:00.000Z"}]}
Sign out another session#
Ends one of your other sessions on its next request. This browser's own session ends by signing out.
/api/me/sessions/{id}Any signed-in person.
Needs a signed-in person: API keys can't call this.
Path parameters
idstringrequired- Session id.
Responses
OK
curl -X DELETE "https://docuflow.pendral.io/api/me/sessions/{id}" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"ok": true}
Your invite codes#
The sign-up invite codes you have made, how many are active, and your limit. Empty of purpose while sign-up is open (enabled: false).
/api/me/invitesAny signed-in person.
Needs a signed-in person: API keys can't call this.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/me/invites" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"enabled": true,"inviteOnly": false,"limit": 50,"active": 1,"lifetimeDays": 1,"invites": [{"id": "clx9k2m4p0001qh8z3v7d5f2a","code": "7KQ2-9XDM","link": "https://docuflow.pendral.io/join/7KQ2-9XDM","status": "status"}]}
Create an invite code#
One single-use code that lets one person create an account. 409 once you hold your limit of active codes (details.limit); one frees up when a code is used, revoked or expires.
/api/me/invitesAny signed-in person.
Needs a signed-in person: API keys can't call this.
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/me/invites" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"invite": {"id": "clx9k2m4p0001qh8z3v7d5f2a","code": "7KQ2-9XDM","link": "https://docuflow.pendral.io/join/7KQ2-9XDM","status": "status","expiresAt": "2026-10-01T12:00:00.000Z"}}
Revoke an invite code#
Your own unused codes only. 409 if it was already used or revoked.
/api/me/invites/{id}Any signed-in person.
Needs a signed-in person: API keys can't call this.
Path parameters
idstringrequired- Invite code id.
Responses
OK
curl -X DELETE "https://docuflow.pendral.io/api/me/invites/{id}" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"ok": true}
Preview an invitation#
Unauthenticated: the token is the credential.
/api/invites/{token}No DocuFlow credential: authenticated by invite token (preview).
Path parameters
tokenstringrequired- Invitation token from the email link.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/invites/{token}"
{"organizationName": "organizationName","role": "role","roleName": "roleName","email": "ada@example.com","invitedByEmail": "invitedByEmail","status": "status","expired": false,"signedInEmail": "signedInEmail"}
Accept an invitation#
Must be signed in as the invited email.
/api/invites/{token}Any signed-in person.
Needs a signed-in person: API keys can't call this.
Path parameters
tokenstringrequired- Invitation token from the email link.
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/invites/{token}" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"ok": true,"organizationId": "clx9k2m4p0001qh8z3v7d5f2a"}
List your workspaces#
List your workspaces
/api/orgsAny signed-in person.
Needs a signed-in person: API keys can't call this.
Responses
OK
curl -X GET "https://docuflow.pendral.io/api/orgs" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION"
{"orgs": [{"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","slug": "invoices"}],"activeOrganizationId": "clx9k2m4p0001qh8z3v7d5f2a"}
Create a workspace#
The creator becomes Owner and the new workspace becomes active.
/api/orgsAny signed-in person.
Needs a signed-in person: API keys can't call this.
Body
application/jsonnamestringrequired
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/orgs" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION" \-H "Content-Type: application/json" \-d '{"name": "Invoices"}'
{"organization": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","slug": "invoices"}}
Switch the active workspace#
Switch the active workspace
/api/orgs/switchAny signed-in person.
Needs a signed-in person: API keys can't call this.
Body
application/jsonorganizationIdstringrequired
Responses
OK
curl -X POST "https://docuflow.pendral.io/api/orgs/switch" \-H "Cookie: __Secure-better-auth.session_token=$DOCUFLOW_SESSION" \-H "Content-Type: application/json" \-d '{"organizationId": "clx9k2m4p0001qh8z3v7d5f2a"}'
{"ok": true}