Skip to Content
Chameleon Docs
API referenceDocuments

Replace document

Writes a document whole, over the version last read. The body is checked against the document's format and stored in its standard form. Send If-Match with the ETag last read; a document changed since answers 412. Cards don't exist until first written: send If-None-Match: * for that write. A document an agent writes changes only what agents change in the saved one: any other part changed answers 422, an issue for each.

PUT
/api/manuals/{id}/documents/{name}

Writes a document whole, over the version last read.

The body is checked against the document's format and stored in its standard form. Send If-Match with the ETag last read; a document changed since answers 412. Cards don't exist until first written: send If-None-Match: * for that write. A document an agent writes changes only what agents change in the saved one: any other part changed answers 422, an issue for each.

Authorization

headerx-api-key<token>

Scope: manuals:write

Path Parameters

id*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
name*string
Value in"labels""image-settings""cards"

Header Parameters

if-match?string
if-none-match?string

Request Body

application/json
  1. body
format*4
Value in4
manualId*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
template?
labelTypes*array<>
pageTypes*array<>
pages*array<>
regions*array<>
groups*array<>
linkedElements*array<>
order?array<>

Response Body

The version now stored

application/json
  1. response
name*string
Value in"labels""image-settings""cards"
format*integer
version*integer
Example Request
curl -X PUT 'https://www.chameleonlabs.org/api/manuals/string/documents/labels' \  -H 'Content-Type: application/json' \  -d '{  "format": 4,  "manualId": "string",  "labelTypes": [    {      "id": "string",      "name": "string",      "color": [        0,        0,        0      ]    }  ],  "pageTypes": [    {      "id": "string",      "name": "string"    }  ],  "pages": [    {      "page": 1,      "size": [        100000,        100000      ]    }  ],  "regions": [    {      "id": "string",      "page": 1,      "polygon": [        [          -100000,          -100000        ],        [          -100000,          -100000        ],        [          -100000,          -100000        ]      ],      "labelType": "string",      "name": "string"    }  ],  "groups": [    {      "id": "string",      "name": "string",      "members": [        "string"      ]    }  ],  "linkedElements": [    {      "id": "string",      "name": "string"    }  ]}'
Example Response
{  "name": "labels",  "format": 0,  "version": 0}