openapi: 3.0.3 info: title: TriplyDB Accounts Assets API version: 26.5.104 description: "REST API for TriplyDB — a linked data database platform.\n\n## Authentication\n\nRead operations on publicly published datasets can be performed without\nauthentication. Write operations and read operations on private or internal\ndatasets require a valid API token.\n\n### Creating an API token\n\n1. Log into your TriplyDB instance.\n2. Click on the user menu in the top-right corner and click on \"User settings\".\n3. Go to the \"API tokens\" tab.\n4. Click \"Create token\", enter a description (e.g., \"my-script\") and select\n the appropriate access rights.\n5. Click \"Create\" and copy the token. It is only shown once upon creation.\n\n### Using the API token\n\nInclude the token in the `Authorization` header of your HTTP requests:\n\n```\nAuthorization: Bearer YOUR_TOKEN\n```\n\n### Security considerations\n\n- **Do not commit tokens to git repositories.**\n- **Do not share tokens** with anyone who should not have access to your\n TriplyDB resources.\n- **Rotate tokens regularly**, especially if you suspect a compromise.\n\n## Pagination\n\nList endpoints are paginated. The response includes a `Link` header\n([RFC 8288](https://www.rfc-editor.org/rfc/rfc8288)) with URLs for\nnavigating the result set. To paginate, follow the URLs in the `Link`\nheader rather than constructing URLs manually.\n\nThe `Link` header contains up to three relations:\n\n| Relation | Meaning |\n|----------|---------|\n| `first` | URL to the first page of results |\n| `next` | URL to the next page (absent when on the last page) |\n| `prev` | URL to the previous page (absent when on the first page) |\n\nExample response header:\n\n```\nLink: ; rel=\"first\",\n ; rel=\"next\"\n```\n\nTo iterate through all results, keep following the `rel=\"next\"` URL until\nit is no longer present. You can control the page size with the `limit`\nquery parameter (default: 30).\n\n## Content negotiation\n\nLinked data endpoints support format negotiation in two ways:\n\n1. **Accept header** — set the `Accept` request header to the desired media type.\n2. **URL extension** — append a format extension to the URL path (e.g., `/run.csv`).\n When present, the extension takes precedence over the `Accept` header.\n" contact: name: Triply url: https://triply.cc servers: - url: https://api.lod.uba.uva.nl description: This instance security: - bearerAuth: [] - {} tags: - name: Assets description: File asset management paths: /datasets/{account}/{dataset}/assets: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' get: tags: - Assets summary: List assets operationId: listAssets security: - {} parameters: - name: fileName in: query description: Filter by file name schema: type: string - $ref: '#/components/parameters/since' - name: sortBy in: query schema: type: string enum: - assetName - $ref: '#/components/parameters/sortDirection' responses: '200': description: Asset list headers: Link: $ref: '#/components/headers/Link' content: application/json: schema: type: array items: $ref: '#/components/schemas/Asset' post: tags: - Assets summary: Upload a new asset operationId: uploadAsset description: 'Uploads a file as a dataset asset. **Simple upload** (files under 5 MB): send the file as `multipart/form-data`. **Large-scale upload** (files over 5 MB): use the [tus resumable upload protocol](https://tus.io/protocols/resumable-upload). ' requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary responses: '201': description: Asset created content: application/json: schema: $ref: '#/components/schemas/Asset' '401': $ref: '#/components/responses/Unauthorized' delete: tags: - Assets summary: Delete all assets operationId: deleteAllAssets responses: '204': description: All assets deleted '401': $ref: '#/components/responses/Unauthorized' /datasets/{account}/{dataset}/assets/download: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' get: tags: - Assets summary: Download an asset by file name operationId: downloadAssetByName security: - {} parameters: - name: fileName in: query required: true schema: type: string responses: '200': description: Asset file content: application/octet-stream: schema: type: string format: binary /datasets/{account}/{dataset}/assets/{assetId}: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' - $ref: '#/components/parameters/assetId' get: tags: - Assets summary: Download an asset by ID operationId: downloadAsset security: - {} responses: '200': description: Asset file (supports Range requests) content: application/octet-stream: schema: type: string format: binary '206': description: Partial content content: application/octet-stream: schema: type: string format: binary delete: tags: - Assets summary: Delete an asset operationId: deleteAsset responses: '204': description: Asset deleted '401': $ref: '#/components/responses/Unauthorized' /datasets/{account}/{dataset}/assets/{assetId}/{versionId}: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' - $ref: '#/components/parameters/assetId' - name: versionId in: path required: true schema: type: string get: tags: - Assets summary: Download a specific asset version operationId: downloadAssetVersion security: - {} responses: '200': description: Asset file content: application/octet-stream: schema: type: string format: binary delete: tags: - Assets summary: Delete an asset version operationId: deleteAssetVersion responses: '200': description: Updated asset with version removed content: application/json: schema: $ref: '#/components/schemas/Asset' '401': $ref: '#/components/responses/Unauthorized' components: parameters: assetId: name: assetId in: path required: true description: Asset identifier schema: type: string since: name: since in: query description: Cursor for pagination. Should be provided using the `link` header schema: type: string sortDirection: name: sortDirection in: query description: Sort direction schema: type: string enum: - asc - desc dataset: name: dataset in: path required: true description: Dataset name schema: type: string account: name: account in: path required: true description: Account name (user or group) schema: type: string responses: Unauthorized: description: Authentication required content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' headers: Link: description: 'RFC 8288 pagination links. Contains `rel="first"` and `rel="next"` URIs for cursor-based pagination. ' schema: type: string example: ; rel="first", ; rel="next" schemas: ErrorResponse: type: object required: - message properties: message: type: string example: Resource not found. code: type: integer example: 404 errors: type: array items: $ref: '#/components/schemas/ErrorResponse' Asset: type: object required: - assetName - createdAt - identifier - versions - url properties: assetName: type: string example: schema-diagram.png createdAt: type: string format: date-time readOnly: true identifier: type: string readOnly: true example: 64a1b2c3d4e5f6001234567b versions: type: array readOnly: true items: $ref: '#/components/schemas/AssetVersion' url: type: string readOnly: true AssetVersion: type: object required: - id - uploadedAt - url - fileSize properties: id: type: string readOnly: true uploadedAt: type: string format: date-time readOnly: true url: type: string readOnly: true fileSize: type: integer readOnly: true example: 204800 uploadedBy: type: object properties: name: type: string accountName: type: string securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT