> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.morphiaone.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.morphiaone.ai/_mcp/server.

# Derive an edited colour Candidate

POST https://api.morphiaone.ai/v1/digitisation/candidates/{candidate_id}/edits
Content-Type: application/json

Derives a new `pending` candidate from one you read, with its `display_color` or
its `material.finish` edited. Send the `candidate_sha256` you read: another
answers `409 CANDIDATE_DIGEST_MISMATCH`. The source is never changed and may be
in any review state; the new candidate names it in `derived_from_candidate_id`
and is reviewed on its own. Its `fields` say which values were measured and
which edited, and staging it asserts them as the draft's `appearance`.
The same edit of the same candidate answers `200` with the candidate it already
made. Send an `Idempotency-Key`: it is required, and a retry with the same key
and the same request answers the first response, byte for byte, with
`Idempotency-Replayed: true`.
Requires the `digitisation.write` scope.

Reference: https://docs.morphiaone.ai/api-reference/endpoints/digitisation/candidates-edit

## Authentication

- `X-API-Key` header (required) — API key for one environment of your account. Keep server-side; never expose in browser clients.

## Request

### Path parameters

- `candidate_id` (string, required)

### Headers

- `Idempotency-Key` (string, optional, nullable)

### Body (application/json)

This endpoint expects an object.

- `candidate_sha256` (string, required)
- `display_color` (string, optional, nullable)
- `material` (V1DigitisationCandidatesCandidateIdEditsPostRequestBodyContentApplicationJsonSchemaMaterial, optional, nullable) — What the shade is made of, as the editor says it is.
- `subject` (V1DigitisationCandidatesCandidateIdEditsPostRequestBodyContentApplicationJsonSchemaSubject, optional, nullable) — The product the images show, as the caller names it. Every field is optional and descriptive: it is what a reviewer reads, never what is measured. A stage of a candidate defaults its ``external_ref`` and ``shade_name`` from it.

## Response

### 200

The candidate this edit already made; a replay under the same Idempotency-Key answers with Idempotency-Replayed: true

- `assessment_id` (string, required)
- `candidate` (map from string to any, required)
- `candidate_sha256` (string, required)
- `colour_contract_version` (integer, required)
- `created_at` (datetime, required)
- `derived_from_candidate_id` (string, required, nullable)
- `fields` (map from string to CandidateField, required)
- `id` (string, required)
- `review_status` (enum, required)
  - Allowed values: `pending`, `accepted`, `rejected`
- `reviewed_at` (datetime, required, nullable)
- `review_url` (string, optional, nullable)
- `reviewed_by` (ReviewActor, optional, nullable) — Who made a decision: ``user``, a person in the Platform, or ``api_key``. It names no person; the Platform shows who.

### 201

The edited candidate, made now and pending review

- `assessment_id` (string, required)
- `candidate` (map from string to any, required)
- `candidate_sha256` (string, required)
- `colour_contract_version` (integer, required)
- `created_at` (datetime, required)
- `derived_from_candidate_id` (string, required, nullable)
- `fields` (map from string to CandidateField, required)
- `id` (string, required)
- `review_status` (enum, required)
  - Allowed values: `pending`, `accepted`, `rejected`
- `reviewed_at` (datetime, required, nullable)
- `review_url` (string, optional, nullable)
- `reviewed_by` (ReviewActor, optional, nullable) — Who made a decision: ``user``, a person in the Platform, or ``api_key``. It names no person; the Platform shows who.

## Errors

### 400 Bad Request Error

Invalid edit or Idempotency-Key

- `error` (ErrorDetail, required)

### 401 Unauthorized Error

Missing or invalid API key

- `error` (ErrorDetail, required)

### 403 Forbidden Error

API key lacks the digitisation.write scope

- `error` (ErrorDetail, required)

### 404 Not Found Error

No such candidate

- `error` (ErrorDetail, required)

### 409 Conflict Error

Another digest, or an idempotency conflict

- `error` (ErrorDetail, required)

### 503 Service Unavailable Error

Digitisation unavailable

- `error` (ErrorDetail, required)

## Types

### V1DigitisationCandidatesCandidateIdEditsPostRequestBodyContentApplicationJsonSchemaMaterial

What the shade is made of, as the editor says it is.

- `finish` (string, required)

### V1DigitisationCandidatesCandidateIdEditsPostRequestBodyContentApplicationJsonSchemaSubject

The product the images show, as the caller names it. Every field is optional and descriptive: it is what a reviewer reads, never what is measured. A stage of a candidate defaults its ``external_ref`` and ``shade_name`` from it.

- `brand` (string, optional, nullable)
- `external_ref` (string, optional, nullable)
- `gtin` (string, optional, nullable)
- `product_name` (string, optional, nullable)
- `shade_name` (string, optional, nullable)

### CandidateField

One field a candidate says: its status, and its value unless abstained.

- `status` (enum, required)
  - Allowed values: `measured`, `abstained`, `edited`
- `value` (string, optional, nullable)

### ReviewActor

Who made a decision: ``user``, a person in the Platform, or ``api_key``. It names no person; the Platform shows who.

- `type` (enum, required)
  - Allowed values: `user`, `api_key`

### ErrorDetail

- `code` (string, required)
- `message` (string, required)
- `request_id` (string, required)
- `details` (ErrorDetailDetails, optional)
- `doc_url` (string, optional, nullable)
- `retryable` (boolean, optional, nullable)

### ErrorDetailDetails

- map from string to any
- list of map from string to any

## Examples

### Digitisation_candidatesEdit_example

**Request**

```json
{
  "candidate_sha256": "string"
}
```

**Response**

```json
{
  "assessment_id": "assessment_2ymes81p3g9df4khy420xba79b",
  "candidate": {
    "assessment_id": "assessment_2ymes81p3g9df4khy420xba79b",
    "assessment_output_sha256": "84c488567666c94b39ccb2f3597b46b95f57e80f3fe9a933d733a59313bee02c",
    "colour_contract_version": 1,
    "derived_from": {
      "candidate_id": "candidate_7kywcdtcgjgavdbn8fwz1c8pn0",
      "candidate_sha256": "b5eeb4cd44f827c527445436a5acd5082e12cf3e1fdc03bc919d8a0157013c72"
    },
    "edits": {
      "display_color": "#B03050",
      "material.finish": "satin"
    },
    "kind": "digitisation.candidate",
    "report": {
      "analyzed_bytes_sha256": "802a63709b9b3660da4dd729a944279d93b7589b3e441ed02e76f8bef05f7038",
      "clipped_fraction": 0,
      "colour_contract_version": 1,
      "icc_profile_sha256": null,
      "image": {
        "height": 64,
        "width": 64
      },
      "kind": "digitisation.colour_report",
      "lab_d65": [
        58.4622,
        28.2503,
        29.7255
      ],
      "mean_linear_rgb": [
        0.57758,
        0.187821,
        0.102242
      ],
      "region": [
        0,
        0,
        32,
        32
      ],
      "source_colour": "untagged",
      "srgb_hex": "#C8785A"
    },
    "report_sha256": "71e13b555f32c8b65ba58ab27a381c200568aa12d72d769152602adc8b2070f5",
    "source": {
      "analyzed_bytes_sha256": "802a63709b9b3660da4dd729a944279d93b7589b3e441ed02e76f8bef05f7038",
      "evidence_id": "evidence_7zx12f2ve43k1axya7x5zraj4p",
      "region": [
        0,
        0,
        32,
        32
      ]
    }
  },
  "candidate_sha256": "270fcf0ea2eccd4e39d51a6d728e6a32ddff1dd7241c148480f0adfceb443e83",
  "colour_contract_version": 1,
  "created_at": "2026-10-26T00:22:25.589041Z",
  "derived_from_candidate_id": "candidate_7kywcdtcgjgavdbn8fwz1c8pn0",
  "fields": {
    "display_color": {
      "status": "edited",
      "value": "#B03050"
    },
    "material.finish": {
      "status": "edited",
      "value": "satin"
    }
  },
  "id": "candidate_5qn2j55r61arg6dgyjq59gdztm",
  "review_status": "pending",
  "reviewed_at": null
}
```

**SDK Code**

```python Digitisation_candidatesEdit_example
import requests

url = "https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits"

payload = { "candidate_sha256": "string" }
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Digitisation_candidatesEdit_example
const url = 'https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"candidate_sha256":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Digitisation_candidatesEdit_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits"

	payload := strings.NewReader("{\n  \"candidate_sha256\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Digitisation_candidatesEdit_example
require 'uri'
require 'net/http'

url = URI("https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"candidate_sha256\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Digitisation_candidatesEdit_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"candidate_sha256\": \"string\"\n}")
  .asString();
```

```php Digitisation_candidatesEdit_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits', [
  'body' => '{
  "candidate_sha256": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Digitisation_candidatesEdit_example
using RestSharp;

var client = new RestClient("https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"candidate_sha256\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Digitisation_candidatesEdit_example
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["candidate_sha256": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "candidate_sha256": "string"
}
```

**Response**

```json
{
  "assessment_id": "string",
  "candidate": {},
  "candidate_sha256": "string",
  "colour_contract_version": 1,
  "created_at": "2024-01-15T09:30:00Z",
  "derived_from_candidate_id": "string",
  "fields": {},
  "id": "string",
  "review_status": "pending",
  "reviewed_at": "2024-01-15T09:30:00Z",
  "review_url": "string",
  "reviewed_by": {
    "type": "user"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits"

payload = { "candidate_sha256": "string" }
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"candidate_sha256":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits"

	payload := strings.NewReader("{\n  \"candidate_sha256\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"candidate_sha256\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"candidate_sha256\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits', [
  'body' => '{
  "candidate_sha256": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"candidate_sha256\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["candidate_sha256": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.morphiaone.ai/v1/digitisation/candidates/candidate_id/edits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```