Skip to main content
POST
/
space
/
{space_id}
/
block
Python
from acontext import AcontextClient

client = AcontextClient(api_key='sk_project_token')

# Create a page
page = client.blocks.create(
    space_id='space-uuid',
    block_type='page',
    title='My Page'
)

# Create a text block under the page
text_block = client.blocks.create(
    space_id='space-uuid',
    parent_id=page['id'],
    block_type='text',
    title='Content',
    props={"text": "Block content here"}
)
{
  "code": 123,
  "error": "<string>",
  "msg": "<string>",
  "data": {
    "id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Project Bearer token (e.g., "Bearer sk-ac-xxxx")

Path Parameters

space_id
string<uuid>
required

Space ID

Body

application/json

CreateBlock payload

type
string
required
Example:

"text"

parent_id
string
props
object
title
string

Response

201 - application/json

Created

code
integer
error
string
msg
string
data
object