Tofu Logo

api

Endpoint:https://chrome.hiretofu.com

POST
https://chrome.hiretofu.com
/api/core/auth/workos/callback/

Unified WorkOS callback — WorkOS is the source of truth.

Expected payload: { "code": "<authorization_code>" }

Three cases:

  1. User exists in both WorkOS and Django → login.
  2. User exists in WorkOS but not Django → provision immediately.
  3. User does not exist in WorkOS → code exchange fails, error returned.

Request Body

  • codestring · required

Responses

  • access_tokenstring · required
  • refresh_tokenstring · required
  • userobject · required

POST
https://chrome.hiretofu.com
/api/core/auth/logout/

Log the current user out.

Two things make logout effective in this architecture:

  1. The webapp proxy clears the tofu-web cookie via its outbound policy, so the browser can no longer present the access token.
  2. The frontend redirects through workos_logout_url (when present) to terminate the WorkOS-side session — otherwise AuthKit would silently re-authenticate on the next /signin.

We deliberately do NOT iterate OutstandingToken and call .blacklist() on each one. The proxy strips refresh tokens from auth responses before they ever reach the client (see set-auth-cookie-outbound), so those rows are orphans — no device holds them, no one can present them to /api/token/refresh/. Blacklisting defends against a threat that doesn't exist here. If we ever start delivering refresh tokens to clients, revisit.

Response: { "message": "Successfully logged out", "workos_logout_url": "https://api.workos.com/.../logout?..." | null, "redirect_to": "/signin" }

Request Body

  • return_tostring

Responses

  • messagestring · required
  • redirect_tostring · required
  • workos_logout_urlstring | null

GET
https://chrome.hiretofu.com
/api/notifications/inbox/

The signed-in user's inbox. Rows are personal, so every action is scoped to the recipient.

query Parameters

  • pageinteger

    A page number within the paginated result set.

  • page_sizeinteger

    Number of results to return per page.

  • unreadboolean

Responses

  • countinteger · required
    Example: 123
  • resultsobject[] · required
  • nextstring | null · uri
    Example: http://api.example.org/accounts/?page=4
  • previousstring | null · uri
    Example: http://api.example.org/accounts/?page=2

POST
https://chrome.hiretofu.com
/api/notifications/inbox/{id}/read/

The signed-in user's inbox. Rows are personal, so every action is scoped to the recipient.

path Parameters

  • idinteger · required

    A unique integer value identifying this notification.

Responses

  • idinteger · readOnly · required
  • event_typereadOnly · required
  • titlestring · readOnly · required
  • bodystring · readOnly · required
  • url_pathstring · readOnly · required

    Frontend path the row links to.

  • contextreadOnly · required
  • job_idinteger | null · readOnly · required
  • delivered_atstring · date-time · readOnly · required

    Set by delivery only. A roll-up moves it, bringing the row back to the top.

  • read_atstring | null · date-time · readOnly · required
  • created_atstring · date-time · readOnly · required
  • updated_atstring · date-time · readOnly · required

POST
https://chrome.hiretofu.com
/api/notifications/inbox/read-all/

The signed-in user's inbox. Rows are personal, so every action is scoped to the recipient.

Responses

  • marked_readinteger · required

GET
https://chrome.hiretofu.com
/api/notifications/inbox/unread-count/

Polled by the bell. Kept to a single count so it stays cheap.

Responses

  • unreadinteger · required