Overview
The User Provisioning API lets trusted partner services create (or look up) Junis user accounts by email and attach them to the partner’s organization as pending members — reusing the standard invite flow, so the user’s first Google login automatically activates the membership and links their Google account.Provisioned accounts do not receive the signup credit bonus and do not have a
memory profile until the user actually logs in with Google for the first time.
Endpoint
Authentication
Include your API key in theX-API-Key header:
Request Parameters
Example Request
Response
When the Email Belongs to an Existing Junis User
If the email already belongs to a real Junis account (someone who has signed in themselves), the account is not attached to your organization and cannot be delegated:Behavior
1
Create-or-get user
If a user with the email already exists, it is returned unchanged (
created: false).
Otherwise a new account is created with google_id = NULL — no signup bonus,
no memory profile (both happen on the real first login).2
Ensure pending membership
If the organization has no membership row for this email, a
pending invite with the
member role is created — identical to inviting the user from the dashboard.3
First Google login links everything
When the user signs in with Google using that email, the account is linked to their
Google identity, the pending membership is activated, and the invited organization
becomes their current organization.
Errors
Acting on Behalf of Provisioned Users
Use the returneduser_id as on_behalf_of in
Chat Completions (requires the users:delegate scope).
Sessions and messages belong to the provisioned user, while subscription checks and
credit charges stay with your API key’s backing user. Pending members are allowed, so
delegation works before the user’s first login.