Appwrite
  1. database
Appwrite
  • account
    • Delete Account
      DELETE
    • Get Account
      GET
    • Create Account
      POST
    • Update Account Email
      PATCH
    • Create Account JWT
      POST
    • Get Account Logs
      GET
    • Update Account Name
      PATCH
    • Update Account Password
      PATCH
    • Get Account Preferences
      GET
    • Update Account Preferences
      PATCH
    • Create Password Recovery
      POST
    • Complete Password Recovery
      PUT
    • Delete All Account Sessions
      DELETE
    • Get Account Sessions
      GET
    • Create Account Session
      POST
    • Create Anonymous Session
      POST
    • Create Account Session with OAuth2
      GET
    • Delete Account Session
      DELETE
    • Get Session By ID
      GET
    • Create Email Verification
      POST
    • Complete Email Verification
      PUT
  • avatars
    • Get Browser Icon
      GET
    • Get Credit Card Icon
      GET
    • Get Favicon
      GET
    • Get Country Flag
      GET
    • Get Image from URL
      GET
    • Get User Initials
      GET
    • Get QR Code
      GET
  • database
    • List Documents
      GET
    • Create Document
      POST
    • Delete Document
      DELETE
    • Get Document
      GET
    • Update Document
      PATCH
  • functions
    • List Executions
    • Create Execution
    • Get Execution
  • locale
    • Get User Locale
    • List Continents
    • List Countries
    • List EU Countries
    • List Countries Phone Codes
    • List Currencies
    • List Languages
  • storage
    • List Files
    • Create File
    • Delete File
    • Get File
    • Update File
    • Get File for Download
    • Get File Preview
    • Get File for View
  • teams
    • List Teams
    • Create Team
    • Delete Team
    • Get Team
    • Update Team
    • Get Team Memberships
    • Create Team Membership
    • Delete Team Membership
    • Update Membership Roles
    • Update Team Membership Status
  1. database

Update Document

PATCH
/database/collections/{collectionId}/documents/{documentId}
database
Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://appwrite.io/v1/database/collections//documents/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data": {},
    "read": [
        "string"
    ],
    "write": [
        "string"
    ]
}'
Response Response Example
{
    "$collection": "string",
    "$id": "string",
    "$permissions": {}
}

Request

Path Params
collectionId
string 
required
Collection unique ID. You can create a new collection with validation rules using the Database service server integration.
documentId
string 
required
Document unique ID.
Body Params application/json
data
object 
required
Document data as JSON object.
read
array[string]
optional
An array of strings with read permissions. By default inherits the existing read permissions. learn more about permissions and get a full list of available permissions.
write
array[string]
optional
An array of strings with write permissions. By default inherits the existing write permissions. learn more about permissions and get a full list of available permissions.
Examples

Responses

🟢200Document
application/json
Body
Document
$collection
string 
required
Collection ID.
$id
string 
required
Document ID.
$permissions
object 
required
Document permissions.
Additional properties
integer  | number  | string  | boolean 
optional
Modified at 2023-08-16 07:28:13
Previous
Get Document
Next
List Executions
Built with