Create file

To create a file item you first need to store it using the upload endpoint.

Headers
  • X-Fabric-Workspace-Id
    Type: string

    Optional. When provided, the request is executed against the specified delegated workspace. If omitted, the parent workspace is used.

Body
application/json
  • attachment
    Type: object
    required
  • mimeType
    Type: string
    required
  • parentId
    required
    • Type: string · UUID Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

      Parent resource ID or an alias (the alias is resolved to the actual ID during the request handling).

  • comment
    • anonymousDisplayName
      Type: string
      min length:  
      1
      max length:  
      100
    • content
      Type: string
      max length:  
      25000
  • location
    • insertAfterId
      Type: string
      required
    • sortKey
      Type: string
      min length:  
      1
      max length:  
      128
      required
  • metadata
    Type: object
  • name
    Type: string
    min length:  
    1
    max length:  
    255
  • tags
    Type: array
  • url
    Type: stringFormat: uri
Responses
  • application/json
Request Example for post/v2/files
curl https://api.fabric.so/v2/files \
  --request POST \
  --header 'X-Fabric-Workspace-Id: ' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "",
  "attachment": {
    "path": "",
    "filename": ""
  },
  "parentId": "",
  "tags": [
    {
      "id": ""
    }
  ],
  "comment": null,
  "location": {
    "sortKey": "",
    "insertAfterId": ""
  },
  "url": "",
  "mimeType": "",
  "metadata": {
    "attributes": {
      "dimensions": {
        "width": null,
        "height": null
      }
    },
    "transcript": {
      "key": ""
    },
    "voiceNote": null
  }
}'
{
  "id": "string",
  "kind": "document",
  "mimeType": null,
  "extension": null,
  "name": null,
  "description": null,
  "icon": {
    "type": "emoji",
    "emoji": "string"
  },
  "size": null,
  "url": "string",
  "commentPinned": null,
  "label": {
    "id": 1,
    "hexColor": "string"
  },
  "parent": {
    "id": "string",
    "name": null
  },
  "cover": null,
  "user": null,
  "root": {
    "id": "string",
    "type": "SYSTEM",
    "subtype": "GOOGLE_DRIVE",
    "isPrivate": true,
    "folder": {
      "id": "string",
      "name": null,
      "user": null
    }
  },
  "stateProcessing": "pending",
  "originUrl": null,
  "tags": [
    {
      "id": "string",
      "name": "string"
    }
  ],
  "chats": [
    {
      "id": "string",
      "name": null,
      "isPinned": true,
      "createdAt": "string",
      "modifiedAt": "string"
    }
  ],
  "thumbnail": {
    "sm": "string",
    "md": "string",
    "lg": "string",
    "xl": "string",
    "original": "string"
  },
  "fileUrl": null,
  "preferences": null,
  "isPasswordProtected": false,
  "isLocked": false,
  "publishedAncestors": [
    {
      "resourceId": "string",
      "accessToken": "string"
    }
  ],
  "createdAt": "string",
  "modifiedAt": "string"
}