Table of Contents
API - Users
The Users API allows you to automate provisioning, lookup, updates, and offboarding of contributor identities inside LinearB. This API is typically used by organizations that synchronize users from i…
Table of Contents
The Users API allows you to automate provisioning, lookup, updates, and offboarding of contributor identities inside LinearB. This API is typically used by organizations that synchronize users from identity systems, maintain centralized contributor records, or need automated onboarding and offboarding workflows.
TL;DR
- Use GET /api/v1/users to search for users in your LinearB organization.
- Use POST /api/v1/users to create one or more users.
- Use PATCH /api/v1/users/{user_id} to update supported user fields.
- Use DELETE /api/v1/users/{user_id} to offboard a former employee.
- Deleting a user preserves their historical activity and existing metrics attribution.
- Deleted users can currently be restored through the LinearB UI. Restoration through the API is planned.
- Users represent developer identities used for LinearB metrics, team membership, and activity attribution.
Overview
The Users API supports:
- Searching and listing users in your LinearB organization
- Creating users with roles and team membership
- Updating supported user attributes
- Managing contributor identity metadata and team scopes
- Deleting users when offboarding former employees
Users represent developer identities used by LinearB to calculate team metrics, pull-request activity, deployments, AI insights, and more.
Before You Begin
Authentication
All Users API requests require an API token.
- Go to Company Settings → API Tokens.
- Create or reuse an API token.
- Add the token to the
x-api-keyheader of every request.
x-api-key: <your_api_token>
User model
User objects can include the following fields (non-exhaustive):
- id — LinearB user ID
- organization_id — owning organization
- name — full name
- email — primary email address
- avatar_url — avatar URL, if available
- created_at, updated_at, and deleted_at — timestamps
- team_membership — team-membership information
- permissions — role and team scopes
- connected_users — linked platform users and contributor identities
-
custom_info — fields such as
extra_emailsandextra_ids
For complete schema details, refer to the Users API documentation linked at the bottom of this article.
When to use this API
- You maintain contributor identities outside LinearB.
- You want automated onboarding and offboarding workflows.
- You need to synchronize email aliases and extra IDs across systems.
- You programmatically manage users associated with teams, deployments, or analytics.
Endpoints and Usage
1. List all users
Retrieve all users
GET /api/v1/users
Returns an optionally paginated list of users in your LinearB organization.
2. Get a user by ID
Retrieve a specific user
GET /api/v1/users/{user_id}
Returns the user record associated with the supplied
user_id.
3. Create users
Create one or more users
POST /api/v1/users
Creates one or more users. Refer to the Users API reference for the supported request schema, required fields, and validation rules.
4. Update a user
Modify supported user fields
PATCH /api/v1/users/{user_id}
Updates supported fields on an existing user. Refer to the current Users API reference for the complete list of writable fields and the request schema.
active field. To offboard a
former employee, use DELETE /api/v1/users/{user_id}.
5. Delete a user
Offboard a former employee
DELETE /api/v1/users/{user_id}
Use deletion when offboarding a former employee. Deleting the user does not erase their historical activity.
The following information is preserved:
- Pull-request activity
- Deployment activity
- Historical metrics attribution
- Other historical contributor activity associated with the identity
If that historical activity should no longer contribute to metrics, exclude the contributor from metrics separately.
6. Restore a deleted user
Restore through the LinearB UI
Deleted users can currently be restored through the LinearB UI. Because their historical data is preserved, that history remains attached to the restored contributor identity.
Restoration through the Users API is not currently available and is planned.
Identity Behavior in LinearB
Multiple emails per user
Users may commit under different email addresses. Adding alternate emails,
for example through custom_info.extra_emails when supported by
the API schema, helps ensure:
- Accurate contributor attribution
- Unified activity across repositories
- Consistent team membership and permissions
Merging duplicate identities
Duplicate accounts, such as multiple Git identities belonging to the same developer, should be merged through the LinearB UI:
- Settings → Users & Teams → ⋮ → Merge Account
User merging is not currently supported through the Users API.
Impact on teams and metrics
- Updating email addresses and additional identity information helps LinearB attribute activity to the correct user.
-
Team membership is represented by
team_membership, with team scopes represented in the user’s permissions. - Changes to users and team memberships may take a short time to appear across all dashboards.
Seat Usage and Billing
The Users API does not currently expose a dedicated
is_billable field.
Use team_membership as the seat-counting signal. A user whose
team_membership value is not null is billable.
Verify and Troubleshoot
Verify an updated user
-
Update a user through
PATCH /api/v1/users/{user_id}using supported fields. -
Confirm that the API returns a successful
2xxresponse and that the response body, if returned, reflects the updated values. -
Call
GET /api/v1/users/{user_id}orGET /api/v1/usersand confirm that the user record contains the expected values. -
In LinearB, go to
Settings → Users & Teams → Users and confirm:
- The user appears with the correct name and email.
- The user’s role and team access match the update.
Verify a deleted user
-
Delete the user through
DELETE /api/v1/users/{user_id}. - Confirm that the API returns a successful
2xxresponse. - In LinearB, confirm that the user no longer appears in the applicable active-user views.
- Confirm that the contributor’s historical activity remains available.
- If required, exclude the contributor’s historical activity from metrics separately.
Quick fixes for common issues
-
User not appearing as expected
— UseGET /api/v1/usersto confirm that the user exists.
— In the UI, clear search, team, and role filters and search using the user’s complete email address. -
Email updates not reflected in activity
— Confirm that all relevant email addresses are associated with the contributor identity.
— Verify that Git commits use one of the configured email addresses.
— Allow time for new activity to be processed. -
422 validation errors
— Confirm that the request body is valid JSON.
— Check the request against the current API schema.
— Confirm that every supplied field is writable and uses the required data type. -
401 Unauthorized or 403 Forbidden
— Confirm that the API token is valid and belongs to the correct organization.
— Send the token in thex-api-key: <your_api_token>header.
— If the request passes through a proxy, confirm that the proxy preserves thex-api-keyheader.
Advanced troubleshooting
Use this matrix when user records still do not behave as expected.
| Problem | Cause | Fix |
|---|---|---|
| User not updated |
The update request failed validation or authorization. Common causes include unsupported fields, invalid field types, or a missing or invalid token. |
Check the HTTP status and response body, especially
400 and 422 error details.Compare the request with the current Users API schema, correct the payload or API token, and resend the request. |
| User is visible through the API but not in UI filters | The user does not match the current UI filters, such as team filters, role filters, or search text. |
Clear the UI filters and search using the complete email address. Use GET /api/v1/users/{user_id} to confirm the user’s
current attributes and team membership.
|
| Duplicate user identities | Multiple user records exist for the same person with different email addresses or connected identities. |
Decide which record should be canonical. Associate all relevant identity information with the canonical user, and use the in-app merge flow where appropriate. |
| Commit activity is not associated with the user | Commits use an email address that is not associated with the contributor identity. | Add the commit email address to the user using a field supported by the current Users API schema, then allow time for new activity to be processed. |
| A deleted user’s historical activity still appears | This is expected. Deleting a user preserves their historical activity and metrics attribution. | If the historical activity should not contribute to metrics, exclude the contributor from metrics separately. |
| A deleted user needs to be restored | User restoration is currently supported through the LinearB UI but not through the Users API. | Restore the user through the LinearB UI. Their preserved historical activity remains attached to the restored identity. |
| Unable to determine whether a user is billable |
The Users API does not expose a dedicated
is_billable field.
|
Check team_membership. A value other than
null indicates that the user is billable.
|
FAQ
Can I delete a user?
Yes. Use DELETE /api/v1/users/{user_id} when offboarding a
former employee.
Does deleting a user remove historical data?
No. Deleting a user preserves their pull requests, deployments, historical metrics attribution, and other historical contributor activity.
How can I remove a former employee’s activity from metrics?
Deleting a user does not erase historical activity. If that activity should not contribute to metrics, exclude the contributor from metrics separately.
Can I restore a deleted user?
Yes. Deleted users can currently be restored through the LinearB UI. Restoration through the Users API is planned but is not currently available.
Does a restored user retain their historical activity?
Yes. Because deletion preserves the contributor’s history, that history remains attached when the user is restored.
How can I tell whether a user is billable?
The Users API does not expose a dedicated is_billable field.
A user whose team_membership value is not
null is billable.
Can I merge users through the API?
No. Merge duplicate contributor identities through the LinearB UI.
For complete endpoint and schema information, visit the Users API documentation .
For additional technical assistance, contact LinearB Support .
How did we do?
API - Teams v2
Generating a LinearB API Token