Changes fields of the workspace's own Trust Profile DRAFT; the public page changes only on trooth_profile_publish. Uses a trooth.co sign-in if the person's role may edit the page (or an agent key with profile:write). Each change names one field by JSON Pointer (/tagline, /founders/-) with a value and its source { url, quote } from the company's own page, or state not_published with a reason. Returns each change as applied or rejected (with code and fix) and the new revision.
View input schema
{
"type": "object",
"properties": {
"workspace": {
"type": "string",
"pattern": "^cid_[0-9a-f]{32}$",
"maxLength": 36,
"description": "With the person's sign-in only: the workspace to act on when the person belongs to more than one, by its trooth.co key (Settings, Organizations). Leave it out for the caller's own workspace or the caller's only one."
},
"changes": {
"type": "array",
"minItems": 1,
"maxItems": 200,
"description": "The changes, applied in order; a rejected change leaves the draft as it was and the ones after it still apply. Fields and their types: https://trooth.co/api/v1/profile/schema. Fields a person keeps (the page address, the theme, review marks) are rejected with code human_only.",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 300,
"description": "The field, as an RFC 6901 JSON Pointer: /tagline, /security/contact, /founders/0/name, or /founders/- to add to the end of a list."
},
"value": {
"description": "The new value, of the field's type. Required unless state is given or op is remove. A picture (/logoUrl, /coverUrl, /founders/0/photoUrl) is a direct https link or the image file itself as a base64 data: URL (data:image/png;base64,..., PNG, JPEG or WebP, at most 140,000 bytes); trooth.co re-encodes and stores its own copy."
},
"source": {
"type": "object",
"description": "Where the value came from. Required for every non-empty value: the https page it was read from, or person: true for the company's own statement no page carries, such as its phone number (kept as stated by the signed-in person, or by the agent key and the person who made it). Without either, the change is rejected with code source_required.",
"properties": {
"url": {
"type": "string",
"maxLength": 2000,
"description": "The https address of the company's own page the value was read from."
},
"person": {
"type": "boolean",
"description": "true: the company states this value itself, for example its phone number, and no page carries it. Kept as stated by the signed-in person, or by the agent key and its maker."
},
"quote": {
"type": "string",
"maxLength": 2000,
"description": "The words on that page, or what the person said."
},
"retrieved_at": {
"type": "string",
"maxLength": 40,
"description": "When the caller read the page (RFC 3339), optional."
}
}
},
"state": {
"type": "string",
"enum": [
"not_published",
"not_applicable"
],
"description": "Instead of a value: the company does not publish this (not_published) or it does not apply (not_applicable). Clears the field. Needs a reason."
},
"reason": {
"type": "string",
"maxLength": 500,
"description": "With state: one sentence on what the caller checked, for example: The security page does not mention penetration testing."
},
"op": {
"type": "string",
"enum": [
"set",
"remove",
"append"
],
"description": "Optional. set (the default), remove, or append to a list."
}
},
"required": [
"path"
],
"additionalProperties": false
}
},
"if_match": {
"type": "string",
"maxLength": 100,
"description": "Optional. The revision the caller read with trooth_profile_get. When someone changed the draft since, nothing is saved and the answer is code revision_changed with the new revision."
},
"expected_revision": {
"type": "string",
"maxLength": 100,
"description": "Optional. The same as if_match, sent to trooth.co in the body. The revision the caller read; when the draft changed since, nothing is saved and the answer is code revision_changed. With if_match, both name the same revision."
},
"idempotency_key": {
"type": "string",
"maxLength": 255,
"description": "Optional. A key of the caller's choosing for this exact set of changes. Retrying with the same key and changes returns the first answer with no second write. When omitted, one is made and returned as idempotency_key."
},
"dry_run": {
"type": "boolean",
"description": "Optional. true checks every change and returns what would be kept, and saves nothing."
},
"fields": {
"type": "array",
"maxItems": 50,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 300,
"pattern": "^[^,]+$"
},
"description": "Optional, with dry_run. Only these parts of the draft the dry run would keep come back: top-level keys or JSON Pointers. Leave it out for the whole draft."
}
},
"required": [
"changes"
],
"additionalProperties": false
}