Skip to content

Native sign-in

Use this flow when your client signs users in with their own email address — a mobile or desktop app, for example. For scripts and integrations acting with a token you generated yourself, use a personal access token instead.

Personal access tokenSession token
Who it representsYou, the token holderThe signed-in user
How it is obtainedGenerated at /me/access_tokensThis flow
LifetimeUntil revoked14 days of inactivity, sliding
Sent asAuthorization: Bearer …Cookie: session_token=…
User revokes at/me/access_tokens/me/sessions
MethodPathPurpose
POST/sessionEmail a 6-character sign-in code
POST/session/magic_linkExchange the code for a session token
POST/session/two_factorComplete 2FA, if the account requires it
DELETE/sessionSign out, destroying the session
Terminal window
curl -X POST https://app.paidcollabs.com/session \
-H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"email_address": "[email protected]"}'
{ "pending_authentication_token": "eyJfcmFpbHMi..." }

Returns 201 Created. The user receives a 6-character code by email, valid for 15 minutes.

Store the pending_authentication_token and send it back in step 2. It is also set as a cookie, so a client with a cookie jar can ignore the response body entirely.

Terminal window
curl -X POST https://app.paidcollabs.com/session/magic_link \
-H "Content-Type: application/json" -H "Accept: application/json" \
-H "X-Pending-Authentication-Token: eyJfcmFpbHMi..." \
-d '{"code": "ABC123"}'
{ "session_token": "eyJfcmFpbHMi..." }

Store the session_token somewhere durable and private — the Keychain on Apple platforms, the Keystore on Android.

If the account has two-factor authentication

Section titled “If the account has two-factor authentication”

Step 2 returns 202 Accepted instead:

{ "two_factor_required": true, "pending_two_factor_token": "eyJfcmFpbHMi..." }

Prompt for the TOTP code (or a backup code) and post it within 5 minutes:

Terminal window
curl -X POST https://app.paidcollabs.com/session/two_factor \
-H "Content-Type: application/json" -H "Accept: application/json" \
-H "X-Pending-Two-Factor-Token: eyJfcmFpbHMi..." \
-d '{"two_factor": {"code": "123456"}}'

The response is the same { "session_token": … } as above.

Send the session token as a cookie:

Terminal window
curl -H "Cookie: session_token=eyJfcmFpbHMi..." \
-H "Accept: application/json" \
https://app.paidcollabs.com/organizations.json

A cookie rather than a Bearer header, deliberately — it is the same credential the web app uses, so there is a single session mechanism on both sides. Most HTTP clients will do this for you automatically if you keep their cookie jar between requests.

Every request slides the 14-day inactivity window. The user can revoke any session from /me/sessions, and revocation takes effect on the next request.

Terminal window
curl -X DELETE https://app.paidcollabs.com/session \
-H "Accept: application/json" \
-H "Cookie: session_token=eyJfcmFpbHMi..."

Returns 204 No Content and destroys the session server-side. Discard your stored copy.

  • OAuth / OpenID Connect. There is no authorization-code flow and no client registration. If you need a third-party integration where your users grant your app access to their PaidCollabs data, that does not exist yet — get in touch.
  • Password sign-in. PaidCollabs has no passwords.
  • Social sign-in. Google and Apple sign-in are web-only; there is no JSON equivalent.