OpenAPI Specification
openapi: 3.0.1
info:
title: Onshape REST Account Company API
description: '## Welcome to the Onshape REST API Explorer
**See the [API Explorer Guide](https://onshape-public.github.io/docs/api-intro/explorer/) for help navigating this page.**
### Using this page
1. Sign in to your [Onshape](https://cad.onshape.com) account in another tab.
2. Click the `Try it out` button below. It toggles to a `Cancel` button when selected.
### Authenticating
To authenticate your calls, click the `Authorize` button. See [API Explorer Guide: Authentication](https://onshape-public.github.io/docs/api-intro/explorer/#authentication) for details. Calls made when authenticated via API Keys or OAuth count against your annual [API limits](https://onshape-public.github.io/docs/auth/limits/#annual-api-call-limits).
* **Tip:** To ensure the current session isn''t used when trying other authentication techniques, make sure to [remove the Onshape cookie](https://support.google.com/chrome/answer/95647#zippy=%2Cdelete-cookies-from-a-site) as per the instructions for your browser, or use a private or incognito window.
### Additional resources
* [Onshape API Guide](https://onshape-public.github.io/docs/): Our full suite of developer guides, to be used as an accompaniment to this API Explorer.
* [Onshape Developer Portal](https://cad.onshape.com/appstore/dev-portal): The Onshape portal for managing your API keys, OAuth2 credentials, your Onshape applications, and your Onshape App Store entries.
* [Authentication Guide](https://onshape-public.github.io/docs/auth/): Our guide to using API keys, request signatures, and OAuth2 in your Onshape applications.'
termsOfService: https://www.onshape.com/legal/terms-of-use
contact:
email: api-support@onshape.zendesk.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.218.84032-34acba44be17
x-logo:
url: images/logo-onshape-gray-green-nav-bar.svg
backgroundColor: '#ffffff'
altText: Onshape
href: images/logo-onshape-gray-green-nav-bar.svg
x-indeterministic-schemas:
- BTDiffInfo
- BTParameterSpecArray-2600
- BTSplineDescription-2118
- NodeModel
- BTPFunctionDeclaration-246
- BTPFunctionOrPredicateDeclaration-247
- BTPExpression-9
- SkinModel
- BTMAnnotation-4664
x-filter-info: ?restUserRole=PUBLIC
servers:
- url: https://cad.onshape.com/api/v16
description: Current
security:
- BasicAuth: []
tags:
- name: Company
description: Access company information.
paths:
/companies:
get:
tags:
- Company
summary: Get all companies to which the specified user belongs.
description: If no user is specified, will return all companies associated with the current user.
operationId: findCompany
parameters:
- name: uid
in: query
schema:
type: string
- name: activeOnly
in: query
schema:
type: boolean
default: true
- name: includeAll
in: query
schema:
type: boolean
default: false
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTListResponseBTCompanyInfo'
deprecated: false
x-BTVisibility: PRODUCTION
/companies/{cid}:
get:
tags:
- Company
summary: Get company information by company ID.
operationId: getCompany
parameters:
- name: cid
in: path
required: true
schema:
type: string
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTCompanyInfo'
deprecated: false
x-BTVisibility: PRODUCTION
/companies/{cid}/documentsbyname:
get:
tags:
- Company
summary: Get document by exact document name.
description: This API can only be called by company admins. Use the `name` field for the exact document name string.
operationId: getDocumentsByName
parameters:
- name: cid
in: path
required: true
schema:
type: string
- name: name
in: query
required: true
schema:
type: string
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
type: array
items:
$ref: '#/components/schemas/BTGlobalTreeNodeSummaryInfo'
deprecated: false
security:
- OAuth2:
- OAuth2Read
BasicAuth:
- OAuth2Read
x-BTVisibility: PRODUCTION
/companies/{cid}/globalpermission/{type}/{id}:
post:
tags:
- Company
summary: Add one or more global permissions to company user or team.
description: "List of global permissions to grant. See [Onshape Help: Global Permissions](https://cad.onshape.com/help/Content/Plans/global_permissions.htm#Assignin) for details on each of the available permissions. \n * `0`: Manage role based access control \n * `1`: Manage users, teams, and aliases \n * `2`: Enterprise administrator \n * `3`: Permanently delete \n * `4`: Analytics administrator \n * `5`: Invite guest users \n * `6`: Create projects \n * `7`: Approve releases \n * `8`: Enable link sharing \n * `9`: Create releases \n * `10`: Allow access to the App Store \n * `11`: Create documents and folders in the Enterprise root \n * `12`: Allow access to public documents \n * `17`: Manage non-geometric items \n * `18`: Manage workflows \n * `19`: Transfer documents out of Enterprise \n * `20`: Sync to configured PLM Integration in Enterprise settings \n * `21`: Create tasks \n * `22`: Manage standard content metadata \n * `23`: Workspace protection permissions \n * `24`: Import files \n * `25`: Use revision tools \n * `26`: Export files \n * `27`: Allow access to Onshape Labs \n"
operationId: addGlobalPermissionsForIdentity
parameters:
- name: cid
in: path
description: Company ID
required: true
schema:
type: string
- name: type
in: path
description: '`0`: USER | `1`: TEAM'
required: true
schema:
type: integer
format: int32
- name: id
in: path
description: User ID or Team ID, depending on `type`
required: true
schema:
type: string
requestBody:
content:
application/json;charset=UTF-8; qs=0.09:
schema:
type: array
items:
type: integer
format: int32
required: true
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTGlobalPermissionInfo'
deprecated: false
security:
- OAuth2:
- OAuth2Write
BasicAuth:
- OAuth2Write
x-BTVisibility: PRODUCTION
delete:
tags:
- Company
summary: Remove global permissions for a company user or team.
description: Clear all or some of a user's global permissions
operationId: clearGlobalPermissions
parameters:
- name: cid
in: path
description: Company ID
required: true
schema:
type: string
- name: type
in: path
description: '`0`: USER | `1`: TEAM'
required: true
schema:
type: integer
format: int32
- name: id
in: path
description: User ID or Team ID, depending on `type`
required: true
schema:
type: string
- name: permission
in: query
description: "List of global permissions to grant. See [Onshape Help: Global Permissions](https://cad.onshape.com/help/Content/Plans/global_permissions.htm#Assignin) for details on each of the available permissions. \n * `0`: Manage role based access control \n * `1`: Manage users, teams, and aliases \n * `2`: Enterprise administrator \n * `3`: Permanently delete \n * `4`: Analytics administrator \n * `5`: Invite guest users \n * `6`: Create projects \n * `7`: Approve releases \n * `8`: Enable link sharing \n * `9`: Create releases \n * `10`: Allow access to the App Store \n * `11`: Create documents and folders in the Enterprise root \n * `12`: Allow access to public documents \n * `17`: Manage non-geometric items \n * `18`: Manage workflows \n * `19`: Transfer documents out of Enterprise \n * `20`: Sync to configured PLM Integration in Enterprise settings \n * `21`: Create tasks \n * `22`: Manage standard content metadata \n * `23`: Workspace protection permissions \n * `24`: Import files \n * `25`: Use revision tools \n * `26`: Export files \n * `27`: Allow access to Onshape Labs \n"
schema:
type: array
items:
type: integer
format: int32
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
type: object
deprecated: false
security:
- OAuth2:
- OAuth2Delete
BasicAuth:
- OAuth2Delete
x-BTVisibility: PRODUCTION
/companies/{cid}/users:
get:
tags:
- Company
summary: Get a list of members in a company.
description: Returns a list of members in the specified company.
operationId: getCompanyUsers
parameters:
- name: cid
in: path
description: Company ID
required: true
schema:
type: string
- name: sortColumn
in: query
description: '`createdAt | modifiedAt | name | firstName | lastName | email | light | lastLoginTime | userRole | state`'
schema:
type: string
default: createdAt
- name: sortOrder
in: query
description: '`desc` (descending, default) | `asc` (ascending)'
schema:
type: string
default: desc
- name: q
in: query
description: Search string to filter users by name or email.
schema:
type: string
default: ''
- name: includeGlobalPermissions
in: query
description: Whether to include global permission info for each user.
schema:
type: boolean
default: false
- name: offset
in: query
description: Offset. Determines where search results begin. Default value is 0.
schema:
minimum: 0
type: integer
format: int32
default: 0
- name: limit
in: query
description: Number of results to return per page. Default value is 20 (also the maximum).
schema:
maximum: 200
minimum: 1
type: integer
format: int32
default: 20
- name: roleFilter
in: query
description: 'Filter by user role ordinal: `0` (OWNER), `1` (ADMIN), `2` (MEMBER). Multiple values allowed. Defaults to all roles.'
schema:
type: array
items:
type: integer
format: int32
- name: afterDateAdded
in: query
description: Filter users added after this date (ISO 8601, e.g. 2026-01-01T00:00:00Z).
schema:
type: string
format: date-time
- name: beforeDateAdded
in: query
description: Filter users added before this date (ISO 8601, e.g. 2026-12-31T23:59:59Z).
schema:
type: string
format: date-time
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTListResponseBTCompanyUserInfo'
deprecated: false
security:
- OAuth2:
- OAuth2Read
BasicAuth:
- OAuth2Read
x-BTVisibility: PRODUCTION
post:
tags:
- Company
summary: Add a user to a company.
description: Returns the company user info.
operationId: addUserToCompany
parameters:
- name: cid
in: path
required: true
schema:
type: string
requestBody:
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTCompanyUserParams'
required: true
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTCompanyUserInfo'
deprecated: false
security:
- OAuth2:
- OAuth2Write
BasicAuth:
- OAuth2Write
x-BTVisibility: PRODUCTION
/companies/{cid}/users/{uid}:
post:
tags:
- Company
summary: Update the company's information for a user.
description: "Returns updated company user info. `globalPermissions` field is deprecated. Please use the following: \n* [addGlobalPermissionsForIdentity](#/Company/addGlobalPermissionsForIdentity) \n* [clearGlobalPermissions](#/Company/clearGlobalPermissions)"
operationId: updateCompanyUser
parameters:
- name: cid
in: path
description: Company ID
required: true
schema:
type: string
- name: uid
in: path
description: User ID
required: true
schema:
type: string
requestBody:
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTCompanyUserParams'
required: true
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
$ref: '#/components/schemas/BTCompanyUserInfo'
deprecated: false
security:
- OAuth2:
- OAuth2Write
BasicAuth:
- OAuth2Write
x-BTVisibility: PRODUCTION
delete:
tags:
- Company
summary: Remove a user from a company, company teams, and all the direct shares.
operationId: removeUserFromCompany
parameters:
- name: cid
in: path
required: true
schema:
type: string
- name: uid
in: path
required: true
schema:
type: string
- name: removeFromTeams
in: query
schema:
type: boolean
default: true
- name: removeDirectShares
in: query
schema:
type: boolean
default: true
responses:
default:
description: default response
content:
application/json;charset=UTF-8; qs=0.09:
schema:
type: object
deprecated: false
security:
- OAuth2:
- OAuth2Delete
BasicAuth:
- OAuth2Delete
x-BTVisibility: PRODUCTION
components:
schemas:
ProratedCharges:
type: object
properties:
amount:
type: integer
format: int64
date:
type: string
format: date-time
description:
type: string
BTThumbnailSizeInfo:
type: object
properties:
href:
type: string
format: uri
mediaType:
type: string
renderMode:
type: string
sheetName:
type: string
size:
type: string
uniqueId:
type: string
viewOrientation:
type: string
BTCompanySummaryInfo:
type: object
properties:
admin:
type: boolean
description:
type: string
domainPrefix:
type: string
enterpriseBaseUrl:
type: string
enterpriseSubtype:
type: integer
format: int32
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
image:
type: string
name:
type: string
description: Name of the resource.
noPublicDocuments:
type: boolean
ownerId:
type: string
secondaryDomainPrefixes:
uniqueItems: true
type: array
items:
type: string
state:
type: integer
format: int32
type:
type: integer
format: int32
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTTeamSummaryInfo:
type: object
properties:
active:
type: boolean
canMove:
type: boolean
connectionName:
type: string
connectionNames:
type: array
items:
type: string
createdAt:
type: string
format: date-time
createdBy:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
description:
type: string
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
isContainer:
type: boolean
isEnterpriseOwned:
type: boolean
isExternalConnectionResource:
type: boolean
isMutable:
type: boolean
modifiedAt:
type: string
format: date-time
modifiedBy:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
name:
type: string
description: Name of the resource.
owner:
$ref: '#/components/schemas/BTOwnerInfo'
parentId:
type: string
predefinedTeam:
type: integer
format: int32
predefinedTeamMutable:
type: boolean
projectId:
type: string
resourceType:
type: string
treeHref:
type: string
unparentHref:
type: string
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
discriminator:
propertyName: jsonType
mapping:
team: '#/components/schemas/BTTeamInfo'
BTCompanyUserParams:
type: object
properties:
admin:
type: boolean
description: Indicates the user is an admin if true.
companyId:
type: string
description: Company ID of the user.
documentationNameOverride:
type: string
description: String to override documentation name.
email:
type: string
description: Email ID of the company user.
globalPermissions:
type: array
description: "List of global permissions to grant. See [Onshape Help: Global Permissions](https://cad.onshape.com/help/Content/Plans/global_permissions.htm#Assignin) for details on each of the available permissions. \n * `0`: Manage role based access control \n * `1`: Manage users, teams, and aliases \n * `2`: Enterprise administrator \n * `3`: Permanently delete \n * `4`: Analytics administrator \n * `5`: Invite guest users \n * `6`: Create projects \n * `7`: Approve releases \n * `8`: Enable link sharing \n * `9`: Create releases \n * `10`: Allow access to the App Store \n * `11`: Create documents and folders in the Enterprise root \n * `12`: Allow access to public documents \n * `17`: Manage non-geometric items \n * `18`: Manage workflows \n * `19`: Transfer documents out of Enterprise \n * `20`: Sync to configured PLM Integration in Enterprise settings \n * `21`: Create tasks \n * `22`: Manage standard content metadata \n * `23`: Workspace protection permissions \n * `24`: Import files \n * `25`: Use revision tools \n * `26`: Export files \n * `27`: Allow access to Onshape Labs \n"
items:
type: integer
description: "List of global permissions to grant. See [Onshape Help: Global Permissions](https://cad.onshape.com/help/Content/Plans/global_permissions.htm#Assignin) for details on each of the available permissions. \n * `0`: Manage role based access control \n * `1`: Manage users, teams, and aliases \n * `2`: Enterprise administrator \n * `3`: Permanently delete \n * `4`: Analytics administrator \n * `5`: Invite guest users \n * `6`: Create projects \n * `7`: Approve releases \n * `8`: Enable link sharing \n * `9`: Create releases \n * `10`: Allow access to the App Store \n * `11`: Create documents and folders in the Enterprise root \n * `12`: Allow access to public documents \n * `17`: Manage non-geometric items \n * `18`: Manage workflows \n * `19`: Transfer documents out of Enterprise \n * `20`: Sync to configured PLM Integration in Enterprise settings \n * `21`: Create tasks \n * `22`: Manage standard content metadata \n * `23`: Workspace protection permissions \n * `24`: Import files \n * `25`: Use revision tools \n * `26`: Export files \n * `27`: Allow access to Onshape Labs \n"
format: int32
guest:
type: boolean
description: Indicates the user is a guest user if true.
light:
type: boolean
description: Indicates the user is a light user if true.
BTDiscountInfo:
type: object
properties:
accountBalance:
type: integer
format: int32
amountOff:
type: integer
format: int32
couponType:
type: integer
format: int32
couponValidMonths:
type: integer
format: int32
createdAt:
type: string
format: date-time
createdBy:
$ref: '#/components/schemas/BTUserSummaryInfo'
expiresAt:
type: string
format: date-time
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
name:
type: string
description: Name of the resource.
ownerId:
type: string
percentOff:
type: integer
format: int32
planId:
type: string
trialEndDate:
type: string
usedAt:
type: string
format: date-time
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTUserDetailSummaryInfo:
type: object
discriminator:
propertyName: jsonType
mapping:
user-detail-summary: '#/components/schemas/BTUserDetailSummaryInfo'
user-summary: '#/components/schemas/BTUserSummaryInfo'
allOf:
- $ref: '#/components/schemas/BTUserBasicSummaryInfo'
- type: object
properties:
documentationName:
type: string
email:
type: string
firstName:
type: string
lastName:
type: string
BTObjectState:
type: string
enum:
- DELETED
- TRASH
- ACTIVE
- INACTIVE
BTAddressInfo:
type: object
properties:
address:
type: string
city:
type: string
country:
type: string
countryCode:
type: string
id:
type: string
state:
type: string
stateCode:
type: string
zip:
type: string
BTCompanyUserInfo:
type: object
properties:
admin:
type: boolean
company:
$ref: '#/components/schemas/BTCompanySummaryInfo'
dateAdded_:
type: string
format: date-time
documentationNameOverride:
type: string
guest:
type: boolean
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
lastLoginTime:
type: string
format: date-time
light:
type: boolean
makePersonalCopies:
type: boolean
name:
type: string
description: Name of the resource.
scheduledRemovalDate:
type: string
format: date-time
state:
type: integer
format: int32
user:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
userRolePriority:
$ref: '#/components/schemas/UserRolePriority'
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTListResponseBTCompanyUserInfo:
type: object
properties:
href:
type: string
description: URI for current page of resources.
format: uri
items:
type: array
description: Array of items in the current page.
items:
$ref: '#/components/schemas/BTCompanyUserInfo'
next:
type: string
description: URI for next page of the resources if more are available.
format: uri
previous:
type: string
description: URI for previous page of the resources.
format: uri
description: A list of resources that typically supports paging.
BTCompanyInfo:
type: object
properties:
address:
$ref: '#/components/schemas/BTAddressInfo'
admin:
type: boolean
description:
type: string
domainPrefix:
type: string
enterpriseBaseUrl:
type: string
enterpriseSubtype:
type: integer
format: int32
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
image:
type: string
name:
type: string
description: Name of the resource.
noPublicDocuments:
type: boolean
ownerId:
type: string
purchase:
$ref: '#/components/schemas/BTPurchaseInfo'
secondaryDomainPrefixes:
uniqueItems: true
type: array
items:
type: string
state:
type: integer
format: int32
type:
type: integer
format: int32
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTWorkspaceInfo:
type: object
properties:
canDelete:
type: boolean
createdAt:
type: string
format: date-time
creator:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
description:
type: string
documentId:
type: string
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
isReadOnly:
type: boolean
lastModifier:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
microversion:
type: string
modifiedAt:
type: string
format: date-time
name:
type: string
description: Name of the resource.
overrideDate:
type: string
format: date-time
parent:
type: string
parents:
type: array
items:
$ref: '#/components/schemas/BTVersionInfo'
protectionRule:
$ref: '#/components/schemas/BTWorkspaceProtectionRuleOptions'
state:
$ref: '#/components/schemas/BTObjectState'
thumbnail:
$ref: '#/components/schemas/BTThumbnailInfo'
type:
type: string
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTVersionInfo:
type: object
properties:
createdAt:
type: string
format: date-time
creator:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
description:
type: string
documentId:
type: string
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
lastModifier:
$ref: '#/components/schemas/BTUserBasicSummaryInfo'
metadataWorkspaceId:
type: string
microversion:
type: string
modifiedAt:
type: string
format: date-time
name:
type: string
description: Name of the resource.
overrideDate:
type: string
format: date-time
parent:
type: string
purpose:
type: integer
format: int32
thumbnail:
$ref: '#/components/schemas/BTThumbnailInfo'
type:
type: string
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTIdentityInfo:
type: object
properties:
company:
$ref: '#/components/schemas/BTCompanySummaryInfo'
href:
type: string
description: URI to fetch complete information of the resource.
format: uri
id:
type: string
description: Id of the resource.
identityType:
type: integer
format: int32
team:
$ref: '#/components/schemas/BTTeamSummaryInfo'
user:
$ref: '#/components/schemas/BTUserSummaryInfo'
viewRef:
type: string
description: URI to visualize the resource in a webclient if applicable.
format: uri
BTGlobalPermissionInfoItem:
type: object
properties:
code:
type: integer
format: int32
identities:
type: array
items:
$ref: '#/components/schemas/BTIdentityInfo'
BTUserSummaryInfo:
type: object
discriminator:
propertyName: jsonType
mapping:
user-summary: '#/components/schemas/BTUserSummaryInfo'
companyuser: '#/components/schemas/BTCompanyUserSummaryInfo'
BTUserAdminSummaryInfo: '#/components/schemas/BTUserAdminSummaryInfo'
userinfo: '#/components/schemas/BTUserInfo'
BTUserOAuth2SummaryInfo: '#/components/schemas/BTUserOAuth2SummaryInfo'
allOf:
- $ref: '#/components/schemas/BTUserDetailSummaryInfo'
- type: object
properties:
company:
$ref: '#/components/schemas/BTCompanySummaryInfo'
companyUserState:
type: integer
format: int32
confirmationRequested:
type: boolean
documentationNameOverride:
type: string
globalPermissions:
$ref: '#/components/schemas/GlobalPermissionInfo'
invitationState:
type: integer
format: int32
isExternal:
type: boolean
isGuest:
type: boolean
isLight:
type: boolean
lastLoginTime:
type: string
format: date-time
personalMessageAllowed:
type: boolean
source:
type: integer
format: int32
BTThumbnailInfo:
type: object
properties:
href:
ty
# --- truncated at 32 KB (51 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/onshape/refs/heads/main/openapi/onshape-company-api-openapi.yml