# Build Your Own Connector

The following table describes:

* The list of MBSE Connector SDK APIs.
* Which APIs are mandatory.
* Recommended order of implementation.
* A brief overview of how MBSE Core calls each API and the expected behavior.

Empty cells in the "Order of Implementation" column indicate optional APIs.

***

## MBSE Connector SDK APIs

| Section                         | API Name                                                                                                                                                                  | Required (Yes/No) | Order of Implementation | Overview                                                                                                                             |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **Registration APIs**           |                                                                                                                                                                           | Yes               | 1                       | APIs required to register and identify the connector to MBSE Core.                                                                   |
|                                 | [Connector Metadata](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/registration-apis/connector-metadata-get)                                   | Yes               |                         | Returns connector metadata and supported capabilities.                                                                               |
|                                 | [Discover SDK](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/registration-apis/discovery-api-get)                                              | Yes               |                         | Returns discovery information and SDK capabilities.                                                                                  |
| **Authentication APIs**         |                                                                                                                                                                           | Yes               | 2                       | APIs required to initialize and cleanup connector sessions.                                                                          |
|                                 | [Initialize](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/authentication-apis/session-initialize)                                             | Yes               |                         | Initializes connection with end system, loads cache, validates credentials.                                                          |
|                                 | [Cleanup](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/authentication-apis/session-logout)                                                    | Yes               |                         | Cleans up session resources and logs out from end system.                                                                            |
| **Metadata APIs**               |                                                                                                                                                                           | Yes               | 3                       | APIs required for configuration, metadata discovery, and system understanding.                                                       |
|                                 | [Get Server Info](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/server-info)                                                     | Yes               |                         | Returns server-level configuration such as max page size and timezone.                                                               |
|                                 | [Get All Projects](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/projects-list)                                                  | Yes               |                         | Returns all projects available in the end system.                                                                                    |
|                                 | [Get All Workspaces](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/workspaces-list)                                              | Optional          |                         | Returns available workspaces if supported by the system.                                                                             |
|                                 | [Get Element Type](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/element-type-get)                                               | Yes               |                         | Returns configuration details for a given element type.                                                                              |
|                                 | [Get Stereotypes](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/stereotype-details)                                              | Yes               |                         | Returns stereotype metadata definitions.                                                                                             |
|                                 | [Get Properties](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/properties-list)                                                  | Yes               |                         | Returns property metadata for a given element type and stereotype.                                                                   |
|                                 | [Get Enumeration Literals](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/enumeration-literals)                                   | Yes               |                         | Returns enumeration values for a property or tag.                                                                                    |
| **Multi Element Revision APIs** |                                                                                                                                                                           | Yes               | 4                       | APIs used for revision-based synchronization.                                                                                        |
|                                 | [Get Revisions](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/multi-element-revision-apis/get-revisions)                                       | Yes               |                         | Returns list of revisions for a project.                                                                                             |
|                                 | [Get Elements Changed In Revision](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/multi-element-revision-apis/get-elements-changed-in-revision) | Yes               |                         | Returns elements changed between two revisions.                                                                                      |
|                                 | [Get Elements At Revision](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/multi-element-revision-apis/get-elements-at-revision)                 | Optional          |                         | Returns element snapshot at a given revision. Required if diff details are not provided in the Get Elements Changed In Revision API. |
| **Element APIs**                |                                                                                                                                                                           | Yes               | 5                       | Core CRUD APIs for elements.                                                                                                         |
|                                 | [Get Element](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/element-apis/element-get)                                                          | Yes               |                         | Retrieves element details based on ID.                                                                                               |
|                                 | [Add Element](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/element-apis/element-add)                                                          | Yes               |                         | Creates a new element.                                                                                                               |
|                                 | [Update Element](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/element-apis/element-update)                                                    | Yes               |                         | Updates an existing element.                                                                                                         |
|                                 | [Query Elements](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/element-apis/element-query)                                                     | Yes               |                         | Searches elements based on criteria and pagination.                                                                                  |
| **Relation APIs**               |                                                                                                                                                                           | Yes               | 6                       | APIs to manage relationships between elements.                                                                                       |
|                                 | [Add Relation](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/relation-apis/create-relation)                                                    | Yes               |                         | Creates a relation between elements.                                                                                                 |
|                                 | [Delete Relation](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/relation-apis/delete-relation)                                                 | Yes               |                         | Deletes an existing relation.                                                                                                        |
| **Branch APIs**                 |                                                                                                                                                                           | Optional\*        | 7                       | Required only if branch-based synchronization is enabled.                                                                            |
|                                 | [Get Branch](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/branch-apis/get-branch)                                                             | Optional          |                         | Retrieves branch details.                                                                                                            |
|                                 | [Create Branch](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/branch-apis/create-branch)                                                       | Optional          |                         | Creates a new branch.                                                                                                                |
|                                 | [Delete Branch](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/branch-apis/delete-branch)                                                       | Optional          |                         | Deletes a branch.                                                                                                                    |
|                                 | [Merge Branch](https://docs.opshub.com/mbse-connector-sdk-index/mbse-sdk-connector-apis/branch-apis/merge-branch)                                                         | Optional          |                         | Merges a branch into the main/master/trunk branch.                                                                                   |

***

## Recommended Order of Implementation

1. Registration APIs
2. Authentication APIs
3. Metadata APIs
4. Revision APIs
5. Element CRUD APIs
6. Relation APIs
7. Branch APIs (if applicable)

This order ensures:

* Connector registration is validated first.
* Session handling works properly.
* Metadata configuration is accurate.
* Revision synchronization is stable.
* Element-level operations are reliable.
* Relation handling is consistent.
* Branch lifecycle is managed safely.

***

## Mandatory vs Optional APIs

### Mandatory APIs

These APIs are required for:

* Revision-based synchronization
* Element CRUD operations
* Metadata configuration
* Connector registration

Without these, the connector cannot function.

### Optional APIs

These APIs are required only if:

* Branch-based synchronization is enabled.
* Workspace concept exists in the system.

***

## Important Notes

* All APIs must follow MBSE SDK URI structure.
* All APIs must implement standardized error handling.
* Pagination must be implemented where required.
* ISO-8601 date format must be used for timestamps.
* Expand behavior must be respected for performance optimization.
* Connector must convert all responses into MBSE DTO structures.

***

## Related Pages

* [SDK API URI Structure](https://docs.opshub.com/mbse-connector-sdk-index/getting-started/mbse-sdk-api-uri-structure)
* [MBSE SDK Best Practices](https://docs.opshub.com/mbse-connector-sdk-index/getting-started/mbse-sdk-best-practices)
* [APIs Required for Each Feature](https://docs.opshub.com/mbse-connector-sdk-index/getting-started/mbse-apis-required-for-each-feature)
* [Error Handling](https://docs.opshub.com/mbse-connector-sdk-index/getting-started/error-handling)
* [Pagination](https://docs.opshub.com/mbse-connector-sdk-index/getting-started/pagination)
* [Passing Configuration Parameters](https://docs.opshub.com/mbse-connector-sdk-index/getting-started/passing-the-configuration-parameters-to-mbse-sdk-apis)

***

This page serves as the master checklist for building an MBSE connector.

Implement APIs in the recommended order to ensure stable and predictable integration behavior.
