Skip to main content

Upsert document at path

PUT 

/documents/docs/:path

Creates or replaces the document at the given path. Path must have an even number of segments (document path). Requires client.documents permission.

Request

Responses

Successful Response

Response shape

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"path": "players/42/progress",
"data": { "level": 10, "xp": 4500 },
"created": true
}

created is false when an existing document at the path was updated.

cURL example

curl -X PUT "https://mw-client-api.wonderfulcoast-218d579d.centralindia.azurecontainerapps.io/documents/docs/players/42/progress" \
-H "x-client-id: <client-id>" \
-H "x-client-secret: <client-secret>" \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: application/json" \
-d '{"data":{"level":10,"xp":4500}}'