Onshape Translation API

Import and export Onshape surfaces, parts, Part Studios, Assemblies, and subassemblies to/from other file formats (STL, PARASOLID, etc).

OpenAPI Specification

onshape-translation-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Onshape REST Account Translation 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: Translation
  description: Import and export Onshape surfaces, parts, Part Studios, Assemblies, and subassemblies to/from other file formats (STL, PARASOLID, etc).
paths:
  /translations/d/{did}:
    get:
      tags:
      - Translation
      summary: Get information on an in-progress or completed translation by document ID.
      operationId: getDocumentTranslations
      parameters:
      - name: did
        in: path
        required: true
        schema:
          type: string
      - name: offset
        in: query
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 0
      - name: limit
        in: query
        schema:
          maximum: 20
          minimum: 1
          type: integer
          format: int32
          default: 20
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8; qs=0.09:
              schema:
                $ref: '#/components/schemas/BTListResponseBTTranslationRequestInfo'
      deprecated: false
      security:
      - OAuth2:
        - OAuth2Read
        BasicAuth:
        - OAuth2Read
      x-BTVisibility: PRODUCTION
  /translations/d/{did}/w/{wid}:
    post:
      tags:
      - Translation
      summary: Import or upload a CAD file into Onshape, and translate the data into parts or assemblies.
      description: "The API call may complete before the translation is finished. If `requestState = ACTIVE`, the translation can be polled until the state is either `DONE` or `FAILED`. Alternatively, a webhook callback can be registered for notification of translation completion (requires `Write` scope if `storeInDocument` is `true`). \n \nSee [API Guide: Import & Export](https://onshape-public.github.io/docs/api-adv/translation/) for examples."
      operationId: createTranslation
      parameters:
      - name: did
        in: path
        required: true
        schema:
          type: string
      - name: wid
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BTBTranslationRequestParams'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8; qs=0.09:
              schema:
                $ref: '#/components/schemas/BTTranslationRequestImportInfo'
      deprecated: false
      security:
      - OAuth2:
        - OAuth2Read
        BasicAuth:
        - OAuth2Read
      x-BTVisibility: PRODUCTION
  /translations/translationformats:
    get:
      tags:
      - Translation
      summary: Get a list of formats this translation can use.
      description: 'Note that we don''t necessarily support both import and export for any given format. See [API Guide: Model Translation](https://onshape-public.github.io/docs/api-adv/translation/) for more details.'
      operationId: getAllTranslatorFormats
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8; qs=0.09:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BTModelFormatFullInfo'
      deprecated: false
      x-BTVisibility: PRODUCTION
  /translations/{tid}:
    get:
      tags:
      - Translation
      summary: Get information on an in-progress or completed translation by translation ID.
      description: "When the translation is complete, `requestState` changes from `ACTIVE` to `DONE` or `FAILED`. See [API Guide: Model Translation](https://onshape-public.github.io/docs/api-adv/translation/) for more details. \n \nWhen polling for translations to complete, use a reasonable interval (e.g., avoid polling multiple times a second, use an exponential backoff strategy, etc.) or use [Webhooks](/docs/app-dev/webhook). See [Rate Limiting](/docs/api-adv/errors/#429) and [API Limits](/docs/auth/limits) for more information."
      operationId: getTranslation
      parameters:
      - name: tid
        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/BTTranslationRequestInfo'
      deprecated: false
      security:
      - OAuth2:
        - OAuth2Read
        BasicAuth:
        - OAuth2Read
      x-BTVisibility: PRODUCTION
    delete:
      tags:
      - Translation
      summary: Delete a translation request.
      operationId: deleteTranslation
      parameters:
      - name: tid
        in: path
        required: true
        schema:
          type: string
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8; qs=0.09:
              schema:
                type: object
      deprecated: false
      security:
      - OAuth2:
        - OAuth2Write
        BasicAuth:
        - OAuth2Write
      x-BTVisibility: PRODUCTION
components:
  schemas:
    BTTranslationRequestState:
      type: string
      enum:
      - ACTIVE
      - DONE
      - FAILED
    BTTranslationRequestInfo:
      type: object
      properties:
        documentId:
          type: string
        exportRuleFileName:
          type: string
          description: The file name after evaluating a rule for the given `formatName`. `NULL` if `evaluateExportRule=false` or if the export rule is not found.
        failureReason:
          type: string
        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.
        requestElementId:
          type: string
        requestState:
          $ref: '#/components/schemas/BTTranslationRequestState'
        resultDocumentId:
          type: string
        resultElementIds:
          type: array
          items:
            type: string
        resultExternalDataIds:
          type: array
          items:
            type: string
        resultWorkspaceId:
          type: string
        versionId:
          type: string
        viewRef:
          type: string
          description: URI to visualize the resource in a webclient if applicable.
          format: uri
        workspaceId:
          type: string
    BTListResponseBTTranslationRequestInfo:
      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/BTTranslationRequestInfo'
        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.
    BTBTranslationRequestParams:
      type: object
      properties:
        allowFaultyParts:
          type: boolean
        createComposite:
          type: boolean
        createDrawingIfPossible:
          type: boolean
        encodedFilename:
          type: string
        extractAssemblyHierarchy:
          type: boolean
        file:
          type: string
          description: The file to upload.
          format: binary
        flattenAssemblies:
          type: boolean
        formatName:
          type: string
        importAppearances:
          type: boolean
        importMaterialDensity:
          type: boolean
        importWithinDocument:
          type: boolean
        joinAdjacentSurfaces:
          type: boolean
        locationElementId:
          type: string
        locationGroupId:
          type: string
        locationPosition:
          type: integer
          format: int32
        makePublic:
          type: boolean
        notifyUser:
          type: boolean
        onePartPerDoc:
          type: boolean
        ownerId:
          type: string
        parentId:
          type: string
        projectId:
          type: string
        repointAppElementVersionRefs:
          type: boolean
        splitAssembliesIntoMultipleDocuments:
          type: boolean
        storeInDocument:
          type: boolean
        translate:
          type: boolean
        unit:
          type: string
        uploadId:
          type: string
        useIGESImportPostProcessing:
          type: boolean
        versionString:
          type: string
        yAxisIsUp:
          type: boolean
      x-BTVisibility-properties:
        versionDescription: INTERNAL
        versionId: INTERNAL
        upgradeFeatureScriptVersion: INTERNAL
        documentId: INTERNAL
        versionName: INTERNAL
        preserveSourceIds: INTERNAL
    BTModelFormatFullInfo:
      type: object
      properties:
        contentType:
          type: string
          description: Content-Type for this file format.
          example: text/csv
        couldBeAssembly:
          type: boolean
          description: Indicates if this format could be an assembly.
          example: true
        fileExtensions:
          type: array
          description: Supported file extensions for this format.
          example:
          - x_t
          - x_b
          - xmt_txt
          - xmt_bin
          items:
            type: string
            description: Supported file extensions for this format.
            example: '["x_t","x_b","xmt_txt","xmt_bin"]'
        name:
          type: string
          description: Name of the format.
          example: STEP
        translatorName:
          type: string
          description: The name of the translator for the format.
          example: step
        validDestinationFormat:
          type: boolean
          description: Indicates if this format is a valid destination format for translation.
          example: true
        validSourceFormat:
          type: boolean
          description: Indicates if this format is a valid source format for translation.
          example: true
    BTTranslationRequestImportInfo:
      type: object
      properties:
        documentId:
          type: string
        failureReason:
          type: string
        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.
        requestElementId:
          type: string
        requestState:
          $ref: '#/components/schemas/BTTranslationRequestState'
        resultDocumentId:
          type: string
        resultElementIds:
          type: array
          items:
            type: string
        resultExternalDataIds:
          type: array
          items:
            type: string
        resultWorkspaceId:
          type: string
        versionId:
          type: string
        viewRef:
          type: string
          description: URI to visualize the resource in a webclient if applicable.
          format: uri
        workspaceId:
          type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      description: Use OAuth 2.0 to authenticate requests.
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize
          tokenUrl: /oauth/token
          refreshUrl: /oauth/token
          scopes:
            OAuth2Internal: Application is Onshape Internal
            OAuth2ReadPII: Application can read your profile information
            OAuth2Read: Application can read your documents
            OAuth2Write: Application can write to your documents
            OAuth2Delete: Application can delete your documents and workspaces
            OAuth2Purchase: Application can request purchases on your behalf
            OAuth2Share: Application can share and unshare documents on your behalf
            document.create: Atlas Application can create a document
            document.edit: Atlas Application can edit a document
            document.delete: Atlas Application can delete a document
            document.read: Atlas Application can read a document
            enterprise.create: Atlas Application can create an enterprise
            enterprise.read: Atlas Application can read from an enterprise
            enterprise.edit: Atlas Application can edit an enterprise
            enterprise.delete: Atlas Application can delete an enterprise
            enterprise.member.create: Atlas Application can create an enterprise member
            enterprise.member.read: Atlas Application can read the details of an enterprise member
            enterprise.member.edit: Atlas Application can edit the details of an enterprise member
            enterprise.member.delete: Atlas Application can delete a member from an enterprise
            webhook.create: Atlas Application can create a webhook on behalf of the logged-in user
            webhook.edit: Atlas Application can edit a webhook on behalf of the logged-in user
            webhook.read: Atlas Application can read a webhook on behalf of the logged-in user
            webhook.delete: Atlas Application can delete a webhook on behalf of the logged-in user
            PLMIntegration: PLM automation can invoke limited operations
    BasicAuth:
      type: http
      description: Use Basic Authentication with API Keys (key as username and secret as password) to authenticate requests.
      scheme: basic