Coda
  1. Docs
Coda
  • Permissions
    • Get sharing metadata
      GET
    • Delete permission
      DELETE
    • Search principals
      GET
    • Get ACL settings
      GET
    • Update ACL settings
      PATCH
    • List permissions
      GET
    • Add permission
      POST
  • Pages
    • Content export status
      GET
    • List pages
      GET
    • Create a page
      POST
    • Begin content export
      POST
    • Get a page
      GET
    • Delete a page
      DELETE
    • Update a page
      PUT
  • Tables
    • List tables
      GET
    • Get a table
      GET
  • Columns
    • List columns
      GET
    • Get a column
      GET
  • Rows
    • Push a button
      POST
    • List table rows
      GET
    • Insert/upsert rows
      POST
    • Delete multiple rows
      DELETE
    • Get a row
      GET
    • Delete row
      DELETE
    • Update row
      PUT
  • Formulas
    • List formulas
    • Get a formula
  • Controls
    • List controls
    • Get a control
  • CustomDocDomains
    • List custom doc domains
    • Add custom domain
    • Deletes a custom domain
    • Updates a custom domain
    • Gets custom doc domains providers
  • Miscellaneous
    • Resolve browser link
    • Get mutation status
  • Automations
    • Trigger automation
  • Analytics
    • List doc analytics
    • List page analytics
    • Get doc analytics summary
    • List Pack analytics
    • Get Pack analytics summary
    • Get analytics last updated day
    • List Pack formula analytics
  • Workspaces
    • List workspace users
    • List workspace roles
    • Updates user role
  • Packs
    • List Packs
    • Create Pack
    • Gets the JSON Schema for Pack configuration.
    • List the versions for a Pack.
    • Get the next valid version for a Pack.
    • Get the difference between two pack versions.
    • Register Pack version
    • Pack version upload complete
    • Create a new Pack release.
    • List the releases for a Pack.
    • Update an existing Pack release.
    • Set the OAuth configurations of the Pack.
    • Retrieve the OAuth configuration of the Pack.
    • List permissions for a Pack
    • Add a permission for Pack
    • Delete a permission for Pack
    • List makers for Pack
    • Add a maker for Pack
    • Delete a maker for Pack
    • List categories for Pack
    • Add a category for Pack
    • Delete a category for Pack
    • Upload a Pack asset.
    • Upload Pack source code.
    • Pack asset upload complete
    • Pack source code upload complete
    • get the source code for a Pack version.
    • List the Pack listings accessible to a user.
    • Get detailed listing information for a Pack.
    • List featured docs for a Pack
    • Update featured docs for a Pack
    • Get a single Pack
    • Update Pack
    • Delete Pack
    • Set the system connection credentials of the Pack.
    • Patch the system connection credentials of the Pack.
    • Retrieve the system connection metadata of the Pack.
    • Retrieve the logs of a Pack.
    • Retrieve the grouped logs of a Pack.
  • Publishing
    • Get doc categories
    • Unpublish doc
    • Publish doc
  • Docs
    • Get info about a doc
      GET
    • Delete doc
      DELETE
    • Update doc
      PATCH
    • Create doc
      POST
    • List available docs
      GET
  • Account
    • Get user info
  1. Docs

Create doc

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/docs
Docs
Creates a new Coda doc, optionally copying an existing doc. Note that creating a doc requires you to be a Doc Maker in the applicable workspace (or be auto-promoted to one).
请求示例请求示例
Python
Shell
JavaScript
Java
curl --location --request POST 'http://dev-cn.your-api-server.com/docs' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title": "Project Tracker",
    "sourceDoc": "iJKlm_noPq",
    "timezone": "America/Los_Angeles",
    "folderId": "fl-ABcdEFgHJi",
    "initialPage": {
        "pageContent": {
            "canvasContent": {
                "format": "html",
                "content": "<p><b>This</b> is rich text</p>"
            },
            "type": "canvas"
        },
        "name": "Launch Status",
        "subtitle": "See the status of launch-related tasks.",
        "iconName": "rocket",
        "imageUrl": "https://example.com/image.jpg",
        "parentPageId": "canvas-tuVwxYz"
    }
}'
响应示例响应示例
201 - 示例 1
{
    "icon": {
        "name": "string",
        "type": "string",
        "browserLink": "https://cdn.coda.io/icons/png/color/icon-32.png"
    },
    "docSize": {
        "totalRowCount": 31337,
        "tableAndViewCount": 42,
        "pageCount": 10,
        "overApiSizeLimit": false
    },
    "published": {
        "mode": "view",
        "description": "Hello World!",
        "browserLink": "https://coda.io/@coda/hello-world",
        "imageLink": "string",
        "discoverable": true,
        "earnCredit": true,
        "categories": [
            "Project Management"
        ]
    },
    "folder": {
        "id": "fl-1Ab234",
        "browserLink": "https://coda.io/docs?folderId=fl-1Ab234",
        "name": "My docs",
        "type": "folder"
    },
    "workspace": {
        "id": "ws-1Ab234",
        "organizationId": "org-2Bc456",
        "browserLink": "https://coda.io/docs?workspaceId=ws-1Ab234",
        "name": "My workspace",
        "type": "workspace"
    },
    "id": "AbCDeFGH",
    "href": "https://coda.io/apis/v1/docs/AbCDeFGH",
    "browserLink": "https://coda.io/d/_dAbCDeFGH",
    "name": "Product Launch Hub",
    "owner": "user@example.com",
    "ownerName": "Some User",
    "createdAt": "2018-04-11T00:18:57.946Z",
    "updatedAt": "2018-04-11T00:18:57.946Z",
    "workspaceId": "ws-1Ab234",
    "folderId": "fl-1Ab234",
    "requestId": "abc-123-def-456",
    "type": "doc",
    "sourceDoc": {
        "id": "AbCDeFGH",
        "href": "https://coda.io/apis/v1/docs/AbCDeFGH",
        "browserLink": "https://coda.io/d/_dAbCDeFGH",
        "type": "doc"
    }
}

请求参数

Body 参数application/json
Payload for creating a new doc.
title
string 
可选
Title of the new doc. Defaults to 'Untitled'.
示例值:
Project Tracker
sourceDoc
string 
可选
An optional doc ID from which to create a copy.
示例值:
iJKlm_noPq
timezone
string 
可选
The timezone to use for the newly created doc.
示例值:
America/Los_Angeles
folderId
string 
可选
The ID of the folder within which to create this doc. Defaults to your "My docs" folder in the oldest workspace you joined; this is subject to change. You can get this ID by opening the folder in the docs list on your computer and grabbing the folderId query parameter.
示例值:
fl-ABcdEFgHJi
initialPage
object 
可选
Payload for creating a new page in a doc.
pageContent
PageCreateContent
可选
Content that can be added to a page at creation time, either text (or rich text) or a URL to create a full-page embed.
name
string 
可选
Name of the page.
示例值:
Launch Status
subtitle
string 
可选
Subtitle of the page.
示例值:
See the status of launch-related tasks.
iconName
string 
可选
Name of the icon.
示例值:
rocket
imageUrl
string 
可选
Url of the cover image to use.
示例值:
https://example.com/image.jpg
parentPageId
string 
可选
The ID of this new page's parent, if creating a subpage.
示例值:
canvas-tuVwxYz
示例

返回响应

🟢201Info about the created doc.
application/json
Body
The result of a doc creation.
icon
object (Icon) 
可选
Info about the icon.
name
string 
必需
Name of the icon.
type
string 
必需
MIME type of the icon
browserLink
string <url>
必需
Browser-friendly link to an icon.
示例值:
https://cdn.coda.io/icons/png/color/icon-32.png
docSize
object (DocSize) 
可选
The number of components within a Coda doc.
totalRowCount
number 
必需
The number of rows contained within all tables of the doc.
示例值:
31337
tableAndViewCount
number 
必需
The total number of tables and views contained within the doc.
示例值:
42
pageCount
number 
必需
The total number of page contained within the doc.
示例值:
10
overApiSizeLimit
boolean 
必需
If true, indicates that the doc is over the API size limit.
示例值:
false
published
object (DocPublished) 
可选
Information about the publishing state of the document.
mode
enum<string> 
必需
Which interaction mode the published doc should use.
枚举值:
viewplayedit
description
string 
可选
Description of the published doc.
示例值:
Hello World!
browserLink
string 
必需
URL to the published doc.
示例值:
https://coda.io/@coda/hello-world
imageLink
string 
可选
URL to the cover image for the published doc.
discoverable
boolean 
必需
If true, indicates that the doc is discoverable.
示例值:
true
earnCredit
boolean 
必需
If true, new users may be required to sign in to view content within this document. You will receive Coda credit for each user who signs up via your doc.
示例值:
true
categories
array[object (DocCategory) {1}] 
必需
Categories applied to the doc.
示例值:
["Project Management"]
folder
object (FolderReference) 
必需
Reference to a Coda folder.
id
string 
必需
ID of the Coda folder.
示例值:
fl-1Ab234
browserLink
string <url>
必需
Browser-friendly link to the folder.
示例值:
https://coda.io/docs?folderId=fl-1Ab234
name
string 
可选
Name of the folder; included if the user has access to the folder.
示例值:
My docs
type
enum<string> 
必需
The type of this resource.
枚举值:
folder
workspace
object (WorkspaceReference) 
必需
Reference to a Coda workspace.
id
string 
必需
ID of the Coda workspace.
示例值:
ws-1Ab234
organizationId
string 
可选
ID of the organization bound to this workspace, if any.
示例值:
org-2Bc456
browserLink
string <url>
必需
Browser-friendly link to the Coda workspace.
示例值:
https://coda.io/docs?workspaceId=ws-1Ab234
name
string 
可选
Name of the workspace; included if the user has access to the workspace.
示例值:
My workspace
type
enum<string> 
必需
The type of this resource.
枚举值:
workspace
id
string 
必需
ID of the Coda doc.
示例值:
AbCDeFGH
href
string <url>
必需
API link to the Coda doc.
示例值:
https://coda.io/apis/v1/docs/AbCDeFGH
browserLink
string <url>
必需
Browser-friendly link to the Coda doc.
示例值:
https://coda.io/d/_dAbCDeFGH
name
string 
必需
Name of the doc.
示例值:
Product Launch Hub
owner
string <email>
必需
Email address of the doc owner.
示例值:
user@example.com
ownerName
string 
必需
Name of the doc owner.
示例值:
Some User
createdAt
string <date-time>
必需
Timestamp for when the doc was created.
示例值:
2018-04-11T00:18:57.946Z
updatedAt
string <date-time>
必需
Timestamp for when the doc was last modified.
示例值:
2018-04-11T00:18:57.946Z
workspaceId
string 
已废弃
ID of the Coda workspace containing this doc.
示例值:
ws-1Ab234
folderId
string 
已废弃
ID of the Coda folder containing this doc.
示例值:
fl-1Ab234
requestId
string 
可选
An arbitrary unique identifier for this request.
示例值:
abc-123-def-456
type
enum<string> 
必需
The type of this resource.
枚举值:
doc
sourceDoc
object 
可选
Reference to a Coda doc.
id
string 
必需
ID of the Coda doc.
示例值:
AbCDeFGH
href
string <url>
必需
API link to the Coda doc.
示例值:
https://coda.io/apis/v1/docs/AbCDeFGH
browserLink
string <url>
必需
Browser-friendly link to the Coda doc.
示例值:
https://coda.io/d/_dAbCDeFGH
type
enum<string> 
必需
The type of this resource.
枚举值:
doc
🟠400400
🟠401401
🟠403403
🟠429429
修改于 2024-03-20 08:13:15
上一页
Update doc
下一页
List available docs
Built with