Memos API
  1. WorkspaceSettingService
Memos API
  • AuthService
    • SignIn signs in the user with the given username and password.
      POST
    • SignInWithSSO signs in the user with the given SSO code.
      POST
    • SignOut signs out the user.
      POST
    • SignUp signs up the user with the given username and password.
      POST
    • GetAuthStatus returns the current auth status of the user.
      POST
  • IdentityProviderService
    • ListIdentityProviders lists identity providers.
      GET
    • CreateIdentityProvider creates an identity provider.
      POST
    • UpdateIdentityProvider updates an identity provider.
      PATCH
    • DeleteIdentityProvider deletes an identity provider.
      DELETE
    • GetIdentityProvider gets an identity provider.
      GET
  • InboxService
    • ListInboxes lists inboxes for a user.
      GET
    • UpdateInbox updates an inbox.
      PATCH
    • DeleteInbox deletes an inbox.
      DELETE
  • MarkdownService
    • GetLinkMetadata returns metadata for a given link.
      GET
    • RestoreMarkdownNodes restores the given nodes to markdown content.
      POST
    • StringifyMarkdownNodes stringify the given nodes to plain text content.
      POST
    • ParseMarkdown parses the given markdown content and returns a list of nodes.
      POST
  • MemoService
    • ListMemos lists memos with pagination and filter.
      GET
    • CreateMemo creates a memo.
      POST
    • DeleteMemoReaction deletes a reaction for a memo.
      DELETE
    • UpdateMemo updates a memo.
      PATCH
    • GetMemo gets a memo.
      GET
    • DeleteMemo deletes a memo.
      DELETE
    • ListMemoComments lists comments for a memo.
      GET
    • CreateMemoComment creates a comment for a memo.
      POST
    • ListMemoReactions lists reactions for a memo.
      GET
    • UpsertMemoReaction upserts a reaction for a memo.
      POST
    • ListMemoRelations lists relations for a memo.
      GET
    • SetMemoRelations sets relations for a memo.
      PATCH
    • ListMemoResources lists resources for a memo.
      GET
    • SetMemoResources sets resources for a memo.
      PATCH
    • ListMemos lists memos with pagination and filter.
      GET
    • DeleteMemoTag deletes a tag for a memo.
      DELETE
    • RenameMemoTag renames a tag for a memo.
      PATCH
  • ResourceService
    • ListResources lists all resources.
    • CreateResource creates a new resource.
    • GetResource returns a resource by name.
    • DeleteResource deletes a resource by name.
    • UpdateResource updates a resource.
    • GetResourceBinary returns a resource binary by name.
  • UserService
    • ListUsers returns a list of users.
    • CreateUser creates a new user.
    • ListAllUserStats returns all user stats.
    • GetUserByUsername gets a user by username.
    • GetUser gets a user by name.
    • DeleteUser deletes a user.
    • ListUserAccessTokens returns a list of access tokens for a user.
    • CreateUserAccessToken creates a new access token for a user.
    • DeleteUserAccessToken deletes an access token for a user.
    • GetUserSetting gets the setting of a user.
    • GetUserStats returns the stats of a user.
    • ListShortcuts returns a list of shortcuts for a user.
    • CreateShortcut creates a new shortcut for a user.
    • DeleteShortcut deletes a shortcut for a user.
    • UpdateShortcut updates a shortcut for a user.
    • UpdateUserSetting updates the setting of a user.
    • UpdateUser updates a user.
    • GetUserAvatarBinary gets the avatar of a user.
  • WebhookService
    • ListWebhooks returns a list of webhooks.
    • CreateWebhook creates a new webhook.
    • GetWebhook returns a webhook by id.
    • DeleteWebhook deletes a webhook by id.
    • UpdateWebhook updates a webhook.
  • WorkspaceService
    • GetWorkspaceProfile returns the workspace profile.
  • WorkspaceSettingService
    • GetWorkspaceSetting returns the setting by name.
      GET
    • SetWorkspaceSetting updates the setting.
      PATCH
  • ActivityService
    • GetActivity returns the activity with the given id.
  1. WorkspaceSettingService

SetWorkspaceSetting updates the setting.

PATCH
/api/v1/workspace/{setting.name}

请求参数

Path 参数
setting.name
string 
必需
name is the name of the setting.
Format: settings/{setting}
正则匹配:
settings/[^/]+
Body 参数application/json
generalSetting
object (apiv1WorkspaceGeneralSetting) 
可选
disallowUserRegistration
boolean 
可选
disallow_user_registration disallows user registration.
disallowPasswordAuth
boolean 
可选
disallow_password_auth disallows password authentication.
additionalScript
string 
可选
additional_script is the additional script.
additionalStyle
string 
可选
additional_style is the additional style.
customProfile
object (apiv1WorkspaceCustomProfile) 
可选
weekStartDayOffset
integer <int32>
可选
week_start_day_offset is the week start day offset from Sunday.
0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
Default is Sunday.
disallowChangeUsername
boolean 
可选
disallow_change_username disallows changing username.
disallowChangeNickname
boolean 
可选
disallow_change_nickname disallows changing nickname.
storageSetting
object (apiv1WorkspaceStorageSetting) 
可选
storageType
enum<string> 
可选
DATABASE: DATABASE is the database storage type.
LOCAL: LOCAL is the local storage type.
S3: S3 is the S3 storage type.
枚举值:
STORAGE_TYPE_UNSPECIFIEDDATABASELOCALS3
默认值:
STORAGE_TYPE_UNSPECIFIED
filepathTemplate
string 
The template of file path. e.g. assets/{timestamp}_{filename}
可选
uploadSizeLimitMb
string <int64>
可选
The max upload size in megabytes.
s3Config
object (Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/) 
可选
memoRelatedSetting
object (apiv1WorkspaceMemoRelatedSetting) 
可选
disallowPublicVisibility
boolean 
可选
disallow_public_visibility disallows set memo as public visibility.
displayWithUpdateTime
boolean 
可选
display_with_update_time orders and displays memo with update time.
contentLengthLimit
integer <int32>
可选
content_length_limit is the limit of content length. Unit is byte.
enableAutoCompact
boolean 
可选
enable_auto_compact enables auto compact for large content.
enableDoubleClickEdit
boolean 
可选
enable_double_click_edit enables editing on double click.
enableLinkPreview
boolean 
可选
enable_link_preview enables links preview.
enableComment
boolean 
可选
enable_comment enables comment.
enableLocation
boolean 
可选
enable_location enables setting location for memo.
defaultVisibility
string 
可选
default_visibility set the global memos default visibility.
reactions
array[string]
可选
reactions is the list of reactions.
disableMarkdownShortcuts
boolean 
可选
disable_markdown_shortcuts disallow the registration of markdown shortcuts.
示例
{
    "generalSetting": {
        "disallowUserRegistration": true,
        "disallowPasswordAuth": true,
        "additionalScript": "string",
        "additionalStyle": "string",
        "customProfile": {
            "title": "string",
            "description": "string",
            "logoUrl": "string",
            "locale": "string",
            "appearance": "string"
        },
        "weekStartDayOffset": 0,
        "disallowChangeUsername": true,
        "disallowChangeNickname": true
    },
    "storageSetting": {
        "storageType": "STORAGE_TYPE_UNSPECIFIED",
        "filepathTemplate": "string",
        "uploadSizeLimitMb": "string",
        "s3Config": {
            "accessKeyId": "string",
            "accessKeySecret": "string",
            "endpoint": "string",
            "region": "string",
            "bucket": "string",
            "usePathStyle": true
        }
    },
    "memoRelatedSetting": {
        "disallowPublicVisibility": true,
        "displayWithUpdateTime": true,
        "contentLengthLimit": 0,
        "enableAutoCompact": true,
        "enableDoubleClickEdit": true,
        "enableLinkPreview": true,
        "enableComment": true,
        "enableLocation": true,
        "defaultVisibility": "string",
        "reactions": [
            "string"
        ],
        "disableMarkdownShortcuts": true
    }
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PATCH '/api/v1/workspace/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "generalSetting": {
        "disallowUserRegistration": true,
        "disallowPasswordAuth": true,
        "additionalScript": "string",
        "additionalStyle": "string",
        "customProfile": {
            "title": "string",
            "description": "string",
            "logoUrl": "string",
            "locale": "string",
            "appearance": "string"
        },
        "weekStartDayOffset": 0,
        "disallowChangeUsername": true,
        "disallowChangeNickname": true
    },
    "storageSetting": {
        "storageType": "STORAGE_TYPE_UNSPECIFIED",
        "filepathTemplate": "string",
        "uploadSizeLimitMb": "string",
        "s3Config": {
            "accessKeyId": "string",
            "accessKeySecret": "string",
            "endpoint": "string",
            "region": "string",
            "bucket": "string",
            "usePathStyle": true
        }
    },
    "memoRelatedSetting": {
        "disallowPublicVisibility": true,
        "displayWithUpdateTime": true,
        "contentLengthLimit": 0,
        "enableAutoCompact": true,
        "enableDoubleClickEdit": true,
        "enableLinkPreview": true,
        "enableComment": true,
        "enableLocation": true,
        "defaultVisibility": "string",
        "reactions": [
            "string"
        ],
        "disableMarkdownShortcuts": true
    }
}'

返回响应

🟢200成功
application/json
A successful response.
Body
name
string 
name is the name of the setting. Format: settings/{setting}
可选
generalSetting
object (apiv1WorkspaceGeneralSetting) 
可选
disallowUserRegistration
boolean 
可选
disallow_user_registration disallows user registration.
disallowPasswordAuth
boolean 
可选
disallow_password_auth disallows password authentication.
additionalScript
string 
可选
additional_script is the additional script.
additionalStyle
string 
可选
additional_style is the additional style.
customProfile
object (apiv1WorkspaceCustomProfile) 
可选
weekStartDayOffset
integer <int32>
可选
week_start_day_offset is the week start day offset from Sunday.
0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
Default is Sunday.
disallowChangeUsername
boolean 
可选
disallow_change_username disallows changing username.
disallowChangeNickname
boolean 
可选
disallow_change_nickname disallows changing nickname.
storageSetting
object (apiv1WorkspaceStorageSetting) 
可选
storageType
enum<string> 
可选
DATABASE: DATABASE is the database storage type.
LOCAL: LOCAL is the local storage type.
S3: S3 is the S3 storage type.
枚举值:
STORAGE_TYPE_UNSPECIFIEDDATABASELOCALS3
默认值:
STORAGE_TYPE_UNSPECIFIED
filepathTemplate
string 
The template of file path. e.g. assets/{timestamp}_{filename}
可选
uploadSizeLimitMb
string <int64>
可选
The max upload size in megabytes.
s3Config
object (Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/) 
可选
memoRelatedSetting
object (apiv1WorkspaceMemoRelatedSetting) 
可选
disallowPublicVisibility
boolean 
可选
disallow_public_visibility disallows set memo as public visibility.
displayWithUpdateTime
boolean 
可选
display_with_update_time orders and displays memo with update time.
contentLengthLimit
integer <int32>
可选
content_length_limit is the limit of content length. Unit is byte.
enableAutoCompact
boolean 
可选
enable_auto_compact enables auto compact for large content.
enableDoubleClickEdit
boolean 
可选
enable_double_click_edit enables editing on double click.
enableLinkPreview
boolean 
可选
enable_link_preview enables links preview.
enableComment
boolean 
可选
enable_comment enables comment.
enableLocation
boolean 
可选
enable_location enables setting location for memo.
defaultVisibility
string 
可选
default_visibility set the global memos default visibility.
reactions
array[string]
可选
reactions is the list of reactions.
disableMarkdownShortcuts
boolean 
可选
disable_markdown_shortcuts disallow the registration of markdown shortcuts.
示例
{
    "name": "string",
    "generalSetting": {
        "disallowUserRegistration": true,
        "disallowPasswordAuth": true,
        "additionalScript": "string",
        "additionalStyle": "string",
        "customProfile": {
            "title": "string",
            "description": "string",
            "logoUrl": "string",
            "locale": "string",
            "appearance": "string"
        },
        "weekStartDayOffset": 0,
        "disallowChangeUsername": true,
        "disallowChangeNickname": true
    },
    "storageSetting": {
        "storageType": "STORAGE_TYPE_UNSPECIFIED",
        "filepathTemplate": "string",
        "uploadSizeLimitMb": "string",
        "s3Config": {
            "accessKeyId": "string",
            "accessKeySecret": "string",
            "endpoint": "string",
            "region": "string",
            "bucket": "string",
            "usePathStyle": true
        }
    },
    "memoRelatedSetting": {
        "disallowPublicVisibility": true,
        "displayWithUpdateTime": true,
        "contentLengthLimit": 0,
        "enableAutoCompact": true,
        "enableDoubleClickEdit": true,
        "enableLinkPreview": true,
        "enableComment": true,
        "enableLocation": true,
        "defaultVisibility": "string",
        "reactions": [
            "string"
        ],
        "disableMarkdownShortcuts": true
    }
}
🔴500服务器错误
修改于 2025-03-15 17:43:05
上一页
GetWorkspaceSetting returns the setting by name.
下一页
GetActivity returns the activity with the given id.
Built with