Busabase
OpenAPI 参考

Assets

Workspace asset management.

POST
/api/v1/assets/upload-urls

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/assets/upload-urls" \  -H "Content-Type: application/json" \  -d '{    "fileName": "string",    "mimeType": "string",    "sizeBytes": -9007199254740991  }'
{  "uploadUrl": "string",  "storageKey": "string",  "publicUrl": "string",  "expiresIn": 0,  "duplicate": true,  "attachmentId": "string",  "assetId": "string"}
POST
/api/v1/assets/confirmations

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/assets/confirmations" \  -H "Content-Type: application/json" \  -d '{    "storageKey": "string",    "fileName": "string",    "mimeType": "string",    "sizeBytes": -9007199254740991  }'
{  "success": true,  "attachmentId": "string",  "assetId": "string",  "storageKey": "string",  "publicUrl": "string"}
GET
/api/v1/assets

Query Parameters

limit?integer

Page size, 1-200. Omit to return every asset (the historical behaviour).

Range1 <= value <= 200
cursor?string

Asset id of the last row of the previous page. Requires limit.

Response Body

application/json

curl -X GET "https://example.com/api/v1/assets"
[  {    "id": "string",    "attachmentId": "string",    "name": "string",    "contentKind": "text",    "metadata": {},    "fileName": "string",    "mimeType": "string",    "size": 0,    "url": "string",    "contentHash": "string",    "usageCount": 0,    "textStatus": "missing",    "createdAt": "string"  }]
GET
/api/v1/assets/{assetId}

Path Parameters

assetId*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/assets/string"
{  "asset": {    "id": "string",    "attachmentId": "string",    "name": "string",    "contentKind": "text",    "metadata": {},    "fileName": "string",    "mimeType": "string",    "size": 0,    "url": "string",    "contentHash": "string",    "usageCount": 0,    "textStatus": "missing",    "createdAt": "string"  },  "usages": [    {      "ownerType": "drive",      "nodeId": "string",      "nodeName": "string",      "nodeType": "string",      "nodeSlug": "string",      "path": "string",      "recordId": "string",      "fieldSlug": "string",      "blockId": "string",      "createdAt": "string"    }  ]}
DELETE
/api/v1/assets/{assetId}

Path Parameters

assetId*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/assets/string"
{  "deleted": true}
PATCH
/api/v1/assets/{assetId}/metadata

Path Parameters

assetId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://example.com/api/v1/assets/string/metadata" \  -H "Content-Type: application/json" \  -d '{    "metadata": {      "property1": null,      "property2": null    }  }'
{  "asset": {    "id": "string",    "attachmentId": "string",    "name": "string",    "contentKind": "text",    "metadata": {},    "fileName": "string",    "mimeType": "string",    "size": 0,    "url": "string",    "contentHash": "string",    "usageCount": 0,    "textStatus": "missing",    "createdAt": "string"  },  "usages": [    {      "ownerType": "drive",      "nodeId": "string",      "nodeName": "string",      "nodeType": "string",      "nodeSlug": "string",      "path": "string",      "recordId": "string",      "fieldSlug": "string",      "blockId": "string",      "createdAt": "string"    }  ]}
GET
/api/v1/assets/{assetId}/content

Path Parameters

assetId*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/assets/string/content"
{  "assetId": "string",  "downloadUrl": "string",  "fileName": "string",  "mimeType": "string",  "size": 0,  "contentHash": "string"}
PUT
/api/v1/assets/{assetId}/text

Path Parameters

assetId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/api/v1/assets/string/text" \  -H "Content-Type: application/json" \  -d '{}'
{  "assetId": "string",  "textStatus": "missing",  "lineCount": 0,  "charCount": 0,  "byteCount": 0}
POST
/api/v1/assets/text/upload-urls

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/assets/text/upload-urls" \  -H "Content-Type: application/json" \  -d '{    "assetId": "string",    "sizeBytes": -9007199254740991  }'
{  "uploadUrl": "string",  "storageKey": "string",  "expiresIn": 0}
GET
/api/v1/assets/{assetId}/text/lines

Path Parameters

assetId*string

Query Parameters

startLine*integer

First line to read. 1-indexed, and INCLUSIVE.

Range1 <= value <= 9007199254740991
endLine*integer

Last line to read, INCLUSIVE. A range wider than 2000 lines is silently narrowed to the first 2000 rather than rejected — the response reports lineCountCapped when that happened, so check it before concluding the file ends there.

Range1 <= value <= 9007199254740991

Response Body

application/json

curl -X GET "https://example.com/api/v1/assets/string/text/lines?startLine=1&endLine=1"
{  "lines": [    "string"  ],  "startLine": -9007199254740991,  "endLine": -9007199254740991,  "totalLines": 0,  "truncated": true}
POST
/api/v1/assets/{assetId}/edit-content

Path Parameters

assetId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/assets/string/edit-content" \  -H "Content-Type: application/json" \  -d '{    "edits": [      {        "oldString": "string",        "newString": "string"      }    ]  }'
{  "id": "string",  "baseId": "string",  "targetType": "base",  "nodeId": "string",  "status": "in_review",  "submittedBy": "string",  "submittedByUser": null,  "sourceAttribution": {    "displayName": "string",    "ownerName": "string",    "channel": "web_ui"  },  "sourceMeta": {    "property1": null,    "property2": null  },  "reviewPolicySnapshot": {    "property1": null,    "property2": null  },  "mergeSummary": {    "property1": null,    "property2": null  },  "rejectedReason": "string",  "reviewedAt": "string",  "mergedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "base": {    "id": "string",    "nodeId": "string",    "slug": "string",    "name": "string",    "description": "string",    "reviewPolicy": {      "kind": "single",      "requiredApprovals": 0    },    "createdAt": "string",    "fields": [      {        "id": "string",        "baseId": "string",        "slug": "string",        "name": "string",        "type": "text",        "required": true,        "position": 0,        "options": {}      }    ]  },  "node": {    "id": "string",    "parentId": "string",    "type": "folder",    "slug": "string",    "name": "string",    "description": "string",    "metadata": {},    "settings": {},    "explicitVisibility": null,    "icon": null,    "position": 0,    "createdAt": "string",    "updatedAt": "string",    "baseId": "string",    "children": [      {        "id": "string",        "parentId": "string",        "type": "folder",        "slug": "string",        "name": "string",        "description": "string",        "metadata": {},        "settings": {},        "explicitVisibility": null,        "icon": null,        "position": 0,        "createdAt": "string",        "updatedAt": "string",        "baseId": "string",        "children": [          null        ],        "hasChildren": true,        "shared": true      }    ],    "hasChildren": true,    "shared": true  },  "operations": [    {      "id": "string",      "changeRequestId": "string",      "baseId": "string",      "targetType": "base",      "nodeId": "string",      "operation": "node_create",      "status": "pending",      "targetRecordId": "string",      "targetViewId": "string",      "filePath": "string",      "sourceRecordId": "string",      "sourceCommitId": "string",      "baseCommitId": "string",      "headCommitId": "string",      "deleteMode": "archive",      "mergedRecordId": "string",      "mergedViewId": "string",      "position": 0,      "createdAt": "string",      "updatedAt": "string",      "headCommit": {        "id": "string",        "baseId": "string",        "targetType": "base",        "nodeId": "string",        "operationId": "string",        "parentCommitId": "string",        "payload": {          "property1": null,          "property2": null        },        "operation": "node_create",        "message": "string",        "author": "string",        "authorUser": null,        "createdAt": "string"      },      "baseFields": {        "property1": null,        "property2": null      }    }  ],  "primaryOperation": {    "id": "string",    "changeRequestId": "string",    "baseId": "string",    "targetType": "base",    "nodeId": "string",    "operation": "node_create",    "status": "pending",    "targetRecordId": "string",    "targetViewId": "string",    "filePath": "string",    "sourceRecordId": "string",    "sourceCommitId": "string",    "baseCommitId": "string",    "headCommitId": "string",    "deleteMode": "archive",    "mergedRecordId": "string",    "mergedViewId": "string",    "position": 0,    "createdAt": "string",    "updatedAt": "string",    "headCommit": {      "id": "string",      "baseId": "string",      "targetType": "base",      "nodeId": "string",      "operationId": "string",      "parentCommitId": "string",      "payload": {        "property1": null,        "property2": null      },      "operation": "node_create",      "message": "string",      "author": "string",      "authorUser": null,      "createdAt": "string"    },    "baseFields": {      "property1": null,      "property2": null    }  },  "operationCount": 0,  "reviews": [    {      "id": "string",      "changeRequestId": "string",      "reviewerId": "string",      "reviewer": null,      "verdict": "approved",      "reason": "string",      "visibleOperationHeads": {        "property1": "string",        "property2": "string"      },      "createdAt": "string"    }  ]}