> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.sibe.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Getting started with the Sibe API

You can read your whole Sibe vault from your own code: folders, files, version history, BOMs and production files, all through a REST API with a personal access token. You can also update file properties, for example to write ERP codes back to your parts. Your first request takes under five minutes.

**Base URL:** [https://api.app.sibe.io](https://api.app.sibe.io/)
**Interactive reference:** [https://api.app.sibe.io/swagger](https://api.app.sibe.io/swagger/index.html), then select **Public API v1** in the definition dropdown
**OpenAPI spec:** [https://api.app.sibe.io/swagger/public-v1/swagger.json](https://api.app.sibe.io/swagger/public-v1/swagger.json)

## 1. Create an API token

1. In the Web Dashboard, open **Settings → Personal Access Tokens**.
2. Click **Create token** and give it a name that says what it is for, for example `erp-sync`.
3. Pick a **Scope**: `Read` to read only, or `ReadWrite` if the token will also update file properties.
4. Copy the token. It is shown **once**. If you lose it, create a new one.

Tokens look like `sibe_pat_…`. Treat them like passwords: never commit one to source control, and never put one in client-side code.

A token acts as you. It sees the same folders and files you see in Sibe, and can change only what you are allowed to change.

## 2. Make your first request

Pass the token in the `X-Api-Key` header. This call lists the top-level folders in your workspace.

```bash
export SIBE_TOKEN="sibe_pat_xxxxxxxxxxxxxxxxxxxx"

curl https://api.app.sibe.io/v1/top-level-folders \
  -H "X-Api-Key: $SIBE_TOKEN"
```

A successful response:

```json
{
  "topLevelFolders": [
    { "id": 1234, "name": "My Project" }
  ],
  "nextCursor": null
}
```

**Paging.** Lists return up to 10 items by default and up to 50 with `?limit=50`. When there is more, the response carries a `nextCursor` value. Pass it back as `?cursor=…` to fetch the next page. A `null` cursor means you have everything.

## 3. Key resources

| Resource | Endpoint |
|---|---|
| Root folders | `GET /v1/top-level-folders` |
| Root folder contents | `GET /v1/top-level-folders/{topLevelFolderId}/children` |
| Folder contents | `GET /v1/items/{itemId}/children` |
| Folder details | `GET /v1/items/{itemId}` |
| List and search files | `GET /v1/files` |
| File details | `GET /v1/files/{fileId}` |
| Find files by name | `POST /v1/files:lookup` |
| File changes feed | `GET /v1/files/changes` |
| Version history | `GET /v1/files/{fileId}/versions` |
| Version metadata | `GET /v1/files/{fileId}/versions/{versionId}/metadata` |
| Metadata of many files | `POST /v1/files:metadata` |
| Version configurations | `GET /v1/files/{fileId}/versions/{versionId}/configurations` |
| Configuration by name | `GET /v1/files/{fileId}/configurations/{configurationName}` |
| Where a configuration is used | `GET /v1/files/{fileId}/configurations/{configurationName}/whereUsed` |
| BOM | `GET /v1/files/{fileId}/versions/{versionId}/bom` |
| BOM of many files | `POST /v1/bom:batch` |
| Artifacts | `GET /v1/files/{fileId}/versions/{versionId}/artifacts` |
| Download a version | `GET /v1/files/{fileId}/versions/{versionId}/download` |
| Bulk download (async) | `POST /v1/files:download`, then poll `GET /v1/downloads/{jobId}` |
| Download archive file | `GET /v1/downloads/{jobId}/file` |
| Export workspace | `GET /v1/export` |
| Resolve user IDs | `POST /v1/users:lookup` |
| Update file properties | `PATCH`, `POST`, `PUT`, `DELETE /v1/files/{fileId}/metadata` (see section 4) |

Every request and response schema is in the [interactive reference](https://api.app.sibe.io/swagger/index.html).

**Where each one earns its place**

- **List and search files** filters by name, top-level folder, release status, release date and any custom property, for example `?prop.Material=Steel`.
- **File changes feed** lists new files, new versions, deletions and release status changes since a point in time, so a sync job only picks up what changed.
- **Metadata of many files** and **BOM of many files** read up to 50 files in one call, instead of one request per file.
- **BOM** returns the live Bill of Materials for a released assembly version, ready to push into your ERP.
- **Artifacts** lists the production files generated for a version, such as PDF, STEP, DXF and DWG, so a manufacturing system can pull them without anyone opening SOLIDWORKS® 3D CAD.
- **Bulk download** packages many files into one archive. Start the job, poll until it is done, then fetch the file.
- **Export workspace** gives you the whole workspace as one JSON file for backups or migrations.
- **Users lookup** turns the user IDs in version metadata into names, for audit reports.

## 4. Update file properties

With a `ReadWrite` token you can add, change and delete the custom properties of a file and of its configurations.

| Action | Endpoint |
|---|---|
| Set, clear or delete some properties | `PATCH /v1/files/{fileId}/metadata` |
| Add new properties only | `POST /v1/files/{fileId}/metadata` |
| Replace the full property list | `PUT /v1/files/{fileId}/metadata` |
| Set one property | `PUT /v1/files/{fileId}/metadata/fields/{name}` |
| Delete properties | `DELETE /v1/files/{fileId}/metadata` |

**Set or change properties.** `fields` holds file-level properties, `fieldsByConfigurations` holds properties per configuration. Properties you don't mention stay as they are.

```bash
curl -X PATCH https://api.app.sibe.io/v1/files/48213/metadata \
  -H "X-Api-Key: $SIBE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": { "Material": "AISI 304", "ErpCode": "100-2045" },
    "fieldsByConfigurations": {
      "Default": { "Description": "Bracket, 2 mm" }
    }
  }'
```

A successful response:

```json
{
  "fileId": 48213,
  "versionId": 90377,
  "versionNumber": 7,
  "isChanged": true
}
```

**Clear or delete.** In a `PATCH`, an empty string `""` clears the value but keeps the property, and `null` deletes the property.

```json
{ "fields": { "Comment": "", "OldErpCode": null } }
```

**Set one property on several configurations.**

```bash
curl -X PUT https://api.app.sibe.io/v1/files/48213/metadata/fields/Length \
  -H "X-Api-Key: $SIBE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "valuesByConfigurations": { "Default": "1200 mm", "Short": "600 mm" } }'
```

**Delete properties.**

```bash
curl -X DELETE https://api.app.sibe.io/v1/files/48213/metadata \
  -H "X-Api-Key: $SIBE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "fields": ["OldErpCode"], "fieldsByConfigurations": { "Default": ["Supplier"] } }'
```

**Good to know**

- Each successful call creates one new version of the file, with the comment *Metadata change*. If nothing actually changes, no version is created and `isChanged` is `false`.
- Changes go to the latest version, which must be **In Progress**. A file that is checked out, locked, pending approval or released can't be changed.
- On SolidWorks files, properties are written into the file itself. On other files, Sibe stores them.
- Only SolidWorks parts and assemblies have configurations.
- Values are text. Property and configuration names are not case-sensitive.
- Properties linked to the model can't be changed, and properties with a list of allowed values accept only those values.
- Up to 100 property changes and 50 configurations per call.
- To make sure nobody checked in a new version since you last looked, add `"expectedVersionId"` with the version you expect. If the latest version is different, nothing is written and you get `409` with code `version_mismatch`.
- `PUT /v1/files/{fileId}/metadata` deletes every property you don't list, at the file level and in each configuration you send. Use it only when your system owns the full list.

## 5. Handle errors

Every error uses [RFC 7807 Problem Details](https://www.rfc-editor.org/rfc/rfc7807) with `Content-Type: application/problem+json`.

```json
{
  "status": 404,
  "title": "Not Found",
  "detail": "File '48213' was not found",
  "traceId": "00-7f3a1b2c3d4e5f6a-1b2c3d4e5f6a7b8c-00"
}
```

| Field | What to look at |
|---|---|
| `status` | HTTP status code |
| `title` | Short problem category |
| `detail` | Exact reason, safe to show to your users |
| `code` | Machine-readable reason, on property update errors |
| `traceId` | Include this when you contact support |

**Common status codes**

| Code | Meaning |
|---|---|
| `400 Bad Request` | Request failed validation. `detail` says what to fix |
| `401 Unauthorized` | `X-Api-Key` header is missing, or the token is invalid |
| `403 Forbidden` | The token has the `Read` scope, or you are not allowed to change this file |
| `404 Not Found` | Resource does not exist, or your token has no access to it |
| `409 Conflict` | The file can't be changed right now. `code` says why |
| `422 Unprocessable Entity` | The change can't be applied. `code` says why |
| `500 Internal Server Error` | Unexpected server failure. Retry with exponential backoff, or contact support with the `traceId` |
| `502 Bad Gateway` | A Sibe service did not respond. Retry with exponential backoff |

**Property update codes**

| Code | Meaning |
|---|---|
| `file_checked_out` | Someone has the file checked out. Try again after check-in |
| `file_locked` | The file is locked |
| `release_pending_approval` | The file is waiting for release approval |
| `file_released` | The file is released. Move it back to In Progress first |
| `version_mismatch` | The latest version is not the one in `expectedVersionId` |
| `metadata_not_ready` | Sibe is still processing the latest version. Try again in a moment |
| `field_already_exists` | `POST` tried to add a property that already exists. Use `PATCH` to change it |
| `configuration_not_supported` | The file has no configurations |
| `configuration_not_found` | A configuration name does not exist on the latest version |
| `property_linked` | The property is linked to the model and can't be changed |
| `property_value_not_allowed` | The value is not in the property's list of allowed values |
| `property_value_invalid_quantity` | The quantity needs a positive amount in an allowed unit, for example `10 mm`, `2.5 kg` or `Ea` |

## Common questions

**Is the API read-only?**
No. A token with the `ReadWrite` scope can update file properties. Check-in, check-out and releases happen in the add-in and the Web Dashboard.

**Who shows up as the author of a property change?**
The token owner. The new version appears in the file history with the comment *Metadata change*.

**Can I change properties of a released file?**
No. Move the file back to In Progress, update it, then release it again.

**How do I revoke a token?**
Remove it under **Settings → Personal Access Tokens**. Requests with that token return `401` from then on.

**Which plan do I need for BOMs and artifacts?**
BOM Management and Automated Exports are on the [Scale plan](https://www.sibe.io/pricing), so those two endpoints return data on Scale workspaces (and on legacy Business Plus workspaces during the transition).

**Is there a rate limit?**
Yes. API access on the Scale plan is rate-limited. If you need higher limits for production work, switch on the **Increased API limits** add-on, available to Scale and Enterprise customers. Add-on pricing is on the [pricing page](https://www.sibe.io/pricing), or ask us in chat and we will enable it.

**What if I get a `500`?**
Retry with exponential backoff. If it keeps failing, send support the `traceId` from the response.

> Still stuck? Start a chat from the bottom-right of any Sibe page, or email [support@sibe.io](mailto:support@sibe.io).
>
> SOLIDWORKS is a registered trademark of Dassault Systèmes SolidWorks Corporation. Sibe is an independent product and is not affiliated with or endorsed by Dassault Systèmes.