For the complete documentation index, see llms.txt. This page is also available as Markdown.

Current User (Me)

me returns information about the account behind the current request. Use it to read identity details and to check what the current user is allowed to do before offering an action in your integration.

me is not a root query field — it lives under the user namespace:

query {
  user {
    me {
      permitted
      canCreateOrg
      hasOrganizations
      user {
        id
        name
        primaryEmail
      }
    }
  }
}

Fields

Field
Type
Description

permitted

Boolean!

Whether the account is allowed to use the application at all. false means the caller authenticated successfully but is not permitted access — data operations return ACCESS_NOT_PERMITTED.

canCreateOrg

Boolean!

Whether the account may create a new organization right now. See below.

hasOrganizations

Boolean!

Whether the account belongs to at least one organization. Useful for hiding actions that require an organization to exist — creating a library, for example.

user

User

The caller's own user record, or null when no user record exists yet for the token.

Identity fields live on user, not on Me itself. Note that the User type exposes primaryEmail (a String!) and emails — there is no email field.

user is nullable by design. A token that authenticates successfully but has no corresponding Duro user yet — during first-time bootstrap, for example — returns user: null with the three booleans still populated. Always null-check it.

Checking whether a user can create an organization

Creating a new organization in Duro is gated: not every account is permitted to do so. Rather than attempting the mutation and handling a failure, query canCreateOrg first and use it to enable or hide a "New organization" affordance in your UI.

canCreateOrg: Boolean!

Returns true when the current user is allowed to create a new organization right now, and false otherwise.

In deployments where organization-creation gating is not enforced, the gate is a no-op and canCreateOrg is true for every authenticated caller. Do not read a true here as evidence that a grant exists.

Where gating is enforced, canCreateOrg is true for a non-archived caller who either:

  • holds a live, unused organization-creation grant issued to their verified email address, or

  • is the Site Admin of at least one active production organization, and so may create a sandbox organization beneath it. This applies only where sandbox entitlements are also enforced.

It is false when neither holds — when the user has no grant, when their grant has already been used or was revoked, or when they administer no organization that can parent a sandbox. Those conditions surface as org-creation error codes if a create is attempted anyway.

canCreateOrg reflects eligibility at the time of the query, and it deliberately skips the more expensive checks the create path performs. It does not verify that a prospective sandbox parent still has quota headroom, so it can report true when every organization you administer is already at its sandbox limit. For the authoritative per-parent check, query user.orgCreationOptions: hasPendingGrant and each parent's headroom. Always treat the organization-creation mutation itself as the source of truth and handle its error codes — canCreateOrg is a hint for the UI, not a guarantee.

Updating your own profile

Profile edits are self-service only: a caller may update their own user record and no one else's. Use updateMe, which takes no user id — the target is resolved from the authenticated caller.

updateMe(input: UpdateUserInput!): User!

The mutation returns the updated User. See UpdateUserInput in Apollo Explorer for the full set of editable fields.

Changing the primary email address has its own mutation rather than going through updateMe, because a new address has to be verified before it can become primary.

Deprecated: update(id: String!, input: UpdateUserInput!): User!

update is the older, id-based form of the same operation. It is deprecated in favor of updateMe:

Use updateMe instead. The id argument is redundant and is rejected unless it matches the caller.

update still works, so no migration deadline applies today, but the id argument buys you nothing: passing another user's id is refused rather than editing that account. Move existing callers to updateMe and drop the id.

Last updated

Was this helpful?