Account

The signed-in user and the workspaces they belong to.

Current user#

The signed-in user, their active workspace and effective permissions.

GET/api/me

Any 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"
Response200
{
"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

PATCH/api/me

Any signed-in person.

Needs a signed-in person: API keys can't call this.

Body

application/json
namestringrequired

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"
}'
Response200
{
"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.

GET/api/me/sessions

Any 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"
Response200
{
"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.

DELETE/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"
Response200
{
"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).

GET/api/me/invites

Any 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"
Response200
{
"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.

POST/api/me/invites

Any 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"
Response200
{
"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.

DELETE/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"
Response200
{
"ok": true
}

Preview an invitation#

Unauthenticated: the token is the credential.

GET/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}"
Response200
{
"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.

POST/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"
Response200
{
"ok": true,
"organizationId": "clx9k2m4p0001qh8z3v7d5f2a"
}

List your workspaces#

List your workspaces

GET/api/orgs

Any 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"
Response200
{
"orgs": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices"
}
],
"activeOrganizationId": "clx9k2m4p0001qh8z3v7d5f2a"
}

Create a workspace#

The creator becomes Owner and the new workspace becomes active.

POST/api/orgs

Any signed-in person.

Needs a signed-in person: API keys can't call this.

Body

application/json
namestringrequired

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"
}'
Response201
{
"organization": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices"
}
}

Switch the active workspace#

Switch the active workspace

POST/api/orgs/switch

Any signed-in person.

Needs a signed-in person: API keys can't call this.

Body

application/json
organizationIdstringrequired

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"
}'
Response200
{
"ok": true
}