Create a definition before assigning its values with Update a sample.
curl https://app.strandai.com/api/v1/sample-fields \ -H "Authorization: Bearer $STRAND_API_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"Study cohort","valueType":"single_select","options":["Discovery","Validation"],"description":"Study arm used for analysis"}'
A successful request returns 201 with the new definition, including its id,
key, label, valueType, origin, storage, writable, options, and
nullable description. The same definition appears in List sample fields.
Omit key to derive it from the label: Study cohort becomes study_cohort.
Explicit keys use 1 to 50 lowercase letters, digits, or _, starting with
a letter. Reserved system keys cannot be created.
Types: text, number, date, checkbox, single_select, multi_select.
type is an alias for valueType. If both are supplied they must agree.
Select types require 1 to 100 options, each 1 to 80 characters and unique ignoring
case. Other types cannot specify options.
Descriptions are optional, trimmed, and limited to 1,000 characters. Empty or
whitespace-only descriptions become null. NUL characters are rejected.
Invalid input returns 400. Duplicate keys, case-insensitive duplicate
labels, or exceeding 100 custom fields per organization returns 409.
Built-in fields do not count toward the cap.
In the dashboard, Manage Fields lets you create and edit descriptions.
Descriptions appear in field-chip tooltips and the field value popover.
Trimmed; blank becomes null. NUL characters are rejected.
Maximum string length: 1000
Response
Created definition
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Strand AI","description":"Spatial proteomics from H\u0026E. Lattice predicts spatially resolved protein-marker maps from routine H\u0026E, delivered as virtual mIF channels.","colors":{"primary":"#004D3B","light":"#006650","dark":"#004D3B"},"logo":{"light":"https://mintcdn.com/strandai/c6Te5vUWVWP-mr0Q/logo-dark.svg?fit=max\u0026auto=format\u0026n=c6Te5vUWVWP-mr0Q\u0026q=85\u0026s=689c0d47abf0f9b5076e963acaffa8d6","dark":"https://mintcdn.com/strandai/c6Te5vUWVWP-mr0Q/logo-white.svg?fit=max\u0026auto=format\u0026n=c6Te5vUWVWP-mr0Q\u0026q=85\u0026s=40bf5ca332d513c816780709e94b8c16","href":"https://strandai.com"},"favicon":"https://mintcdn.com/strandai/vTcOY54DE0LzRJ_f/favicon.svg?fit=max\u0026auto=format\u0026n=vTcOY54DE0LzRJ_f\u0026q=85\u0026s=20b05705652e3edd7ffcd411efa9417b","api":{"openapi":"api-reference/openapi.json","examples":{"languages":["python","curl","javascript","php","go","java","ruby"]}},"background":{"color":{"light":"#F2F1ED","dark":"#00120A"}},"navbar":{"links":[{"href":"mailto:support@strandai.com","label":"Support"}],"primary":{"type":"button","label":"Platform","href":"https://app.strandai.com"}},"footer":{"socials":{"website":"https://strandai.com","github":"https://github.com/strand-ai"}},"seo":{"metatags":{"og:site_name":"Strand AI Docs","og:type":"website","og:image":"https://docs.strandai.com/images/og-card.png","twitter:image":"https://docs.strandai.com/images/og-card.png","twitter:card":"summary_large_image"},"indexing":"all"},"fonts":{"heading":{"family":"PP Telegraf","weight":400,"source":"fonts/PPTelegraf-Regular.woff2","format":"woff2"},"body":{"family":"Source Sans 3"}},"styling":{"codeblocks":"dark","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"strandai","hasAudioNarration":false,"actualSubdomain":"strandai","customDomains":["docs.strandai.com"],"gitSource":{"type":"github","owner":"strand-ai","repo":"strand-official","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aed2920ae91a51b78f747cf","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"API reference","count":34},{"language":"default","tag":"Endpoints","count":33},{"language":"default","tag":"Guides","count":8},{"language":"default","tag":"SDKs","count":4},{"language":"default","tag":"Programmatic workflows","count":4},{"language":"default","tag":"Plan a run","count":3},{"language":"default","tag":"MCP","count":3},{"language":"default","tag":"Connect an agent","count":3},{"language":"default","tag":"Manage and explore","count":2},{"language":"default","tag":"Get started","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/endpoint/createSampleField","slug":"/api-reference/endpoint/createSampleField","pageMetadata":{"title":"Create a custom sample field","description":"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.","openapi":"POST /sample-fields","href":"/api-reference/endpoint/createSampleField"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Create a definition before assigning its values with `,_jsx(_components.a,{href:`/api-reference/endpoint/patchSample`,children:`Update a sample`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://app.strandai.com/api/v1/sample-fields`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$STRAND_API_KEY`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '{\"label\":\"Study cohort\",\"valueType\":\"single_select\",\"options\":[\"Discovery\",\"Validation\"],\"description\":\"Study arm used for analysis\"}'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A successful request returns `,_jsx(_components.strong,{children:`201`}),` with the new definition, including its `,_jsx(_components.code,{children:`id`}),`,\n`,_jsx(_components.code,{children:`key`}),`, `,_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`valueType`}),`, `,_jsx(_components.code,{children:`origin`}),`, `,_jsx(_components.code,{children:`storage`}),`, `,_jsx(_components.code,{children:`writable`}),`, `,_jsx(_components.code,{children:`options`}),`, and\nnullable `,_jsx(_components.code,{children:`description`}),`. The same definition appears in `,_jsx(_components.a,{href:`/api-reference/endpoint/listSampleFields`,children:`List sample fields`}),`.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Omit `,_jsx(_components.code,{children:`key`}),` to derive it from the label: `,_jsx(_components.code,{children:`Study cohort`}),` becomes `,_jsx(_components.code,{children:`study_cohort`}),`.\nExplicit keys use 1 to 50 lowercase letters, digits, or `,_jsx(_components.code,{children:`_`}),`, starting with\na letter. Reserved system keys cannot be created.`]}),`\n`,_jsxs(_components.li,{children:[`Types: `,_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`number`}),`, `,_jsx(_components.code,{children:`date`}),`, `,_jsx(_components.code,{children:`checkbox`}),`, `,_jsx(_components.code,{children:`single_select`}),`, `,_jsx(_components.code,{children:`multi_select`}),`.\n`,_jsx(_components.code,{children:`type`}),` is an alias for `,_jsx(_components.code,{children:`valueType`}),`. If both are supplied they must agree.`]}),`\n`,_jsx(_components.li,{children:`Select types require 1 to 100 options, each 1 to 80 characters and unique ignoring\ncase. Other types cannot specify options.`}),`\n`,_jsxs(_components.li,{children:[`Descriptions are optional, trimmed, and limited to 1,000 characters. Empty or\nwhitespace-only descriptions become `,_jsx(_components.code,{children:`null`}),`. NUL characters are rejected.`]}),`\n`,_jsxs(_components.li,{children:[`Invalid input returns `,_jsx(_components.strong,{children:`400`}),`. Duplicate keys, case-insensitive duplicate\nlabels, or exceeding 100 custom fields per organization returns `,_jsx(_components.strong,{children:`409`}),`.\nBuilt-in fields do not count toward the cap.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`In the dashboard, `,_jsx(_components.strong,{children:`Manage Fields`}),` lets you create and edit descriptions.\nDescriptions appear in field-chip tooltips and the field value popover.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Create a custom sample field","description":"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.","openapi":"POST /sample-fields","href":"/api-reference/endpoint/createSampleField"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/strandai/a92a1cb8d942860f/posthog-pageviews.js"],"openApiReferenceData":{"operation":{"summary":"Create a custom sample field","description":"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.","requestBody":"611d24c4-bf77-41b0-89d7-4ebc9567d6f3","responses":{"201":"52e8e995-73b9-4ff3-b8d1-fb179f7dc63b","400":"caa1194d-12bd-405f-a070-cef8866a1929","401":"585c06c0-df8f-43e4-8754-55d2b2bcfdc5","409":"94a4f781-4e7b-4f0f-bd52-f20aa941077b"},"method":"post","type":"path","servers":["d22a4fb9-2508-4e5a-b719-b7d7837b5678"],"security":["8a2126e8-9bac-432f-9f56-c3740489aeeb","98fbb24f-9a8c-480c-99a8-a0549d6a4dcd"],"path":"/sample-fields","baseUrlOptions":["https://app.strandai.com/api/v1"],"title":"Create a custom sample field","codeSamples":[],"requestExampleLanguages":["python","bash","javascript","php","go","java","ruby"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["label","valueType"],"properties":{"label":{"type":"string","minLength":1,"maxLength":80,"isRequired":true,"uniqueKey":"oneOf.0.label","typeLabel":"string"},"valueType":{"type":"string","enum":["text","number","date","checkbox","single_select","multi_select"],"isRequired":true,"uniqueKey":"oneOf.0.valueType","typeLabel":"enum\u003cstring>"},"type":{"type":"string","enum":["text","number","date","checkbox","single_select","multi_select"],"description":"Alias for valueType; must agree if both are supplied.","uniqueKey":"oneOf.0.type","typeLabel":"enum\u003cstring>"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,49}$","description":"Reserved system keys are rejected.","uniqueKey":"oneOf.0.key","typeLabel":"string"},"options":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":80,"uniqueKey":"oneOf.0.options.items.[INDEX]","typeLabel":"string"},"description":"Required only for select types. Case-insensitively unique.","uniqueKey":"oneOf.0.options","typeLabel":"string[]"},"description":{"oneOf":[{"type":"string","maxLength":1000,"description":"Trimmed; blank becomes null. NUL characters are rejected.","uniqueKey":"oneOf.0.description.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":1000,"description":"Trimmed; blank becomes null. NUL characters are rejected.","uniqueKey":"oneOf.0.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.description","typeLabel":"string | null"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["label","type"],"properties":{"label":{"type":"string","minLength":1,"maxLength":80,"isRequired":true,"uniqueKey":"oneOf.1.label","typeLabel":"string"},"type":{"type":"string","enum":["text","number","date","checkbox","single_select","multi_select"],"description":"Alias for valueType; must agree if both are supplied.","isRequired":true,"uniqueKey":"oneOf.1.type","typeLabel":"enum\u003cstring>"},"valueType":{"type":"string","enum":["text","number","date","checkbox","single_select","multi_select"],"uniqueKey":"oneOf.1.valueType","typeLabel":"enum\u003cstring>"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,49}$","description":"Reserved system keys are rejected.","uniqueKey":"oneOf.1.key","typeLabel":"string"},"options":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":80,"uniqueKey":"oneOf.1.options.items.[INDEX]","typeLabel":"string"},"description":"Required only for select types. Case-insensitively unique.","uniqueKey":"oneOf.1.options","typeLabel":"string[]"},"description":{"oneOf":[{"type":"string","maxLength":1000,"description":"Trimmed; blank becomes null. NUL characters are rejected.","uniqueKey":"oneOf.1.description.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":1000,"description":"Trimmed; blank becomes null. NUL characters are rejected.","uniqueKey":"oneOf.1.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.description","typeLabel":"string | null"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"label":"\u003cstring>","key":"\u003cstring>","options":["\u003cstring>"],"description":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"52e8e995-73b9-4ff3-b8d1-fb179f7dc63b":{"description":"Created definition","content":{"application/json":{"schema":{"$ref":"abcb3857-8e33-46ae-bb08-514f42ff67fc"}}},"exampleType":"generated"},"caa1194d-12bd-405f-a070-cef8866a1929":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"reason":{"oneOf":[{"type":"string","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"},"required":{"oneOf":[{"type":"integer","uniqueKey":"required.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"required.oneOf.1","typeLabel":"null"}],"uniqueKey":"required","typeLabel":"integer | null"},"retryAfterSeconds":{"oneOf":[{"type":"integer","uniqueKey":"retryAfterSeconds.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"retryAfterSeconds.oneOf.1","typeLabel":"null"}],"uniqueKey":"retryAfterSeconds","typeLabel":"integer | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","reason":"\u003cstring>","required":123,"retryAfterSeconds":123}}},"exampleType":"generated"}},"exampleType":"generated"},"585c06c0-df8f-43e4-8754-55d2b2bcfdc5":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"reason":{"oneOf":[{"type":"string","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"},"required":{"oneOf":[{"type":"integer","uniqueKey":"required.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"required.oneOf.1","typeLabel":"null"}],"uniqueKey":"required","typeLabel":"integer | null"},"retryAfterSeconds":{"oneOf":[{"type":"integer","uniqueKey":"retryAfterSeconds.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"retryAfterSeconds.oneOf.1","typeLabel":"null"}],"uniqueKey":"retryAfterSeconds","typeLabel":"integer | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","reason":"\u003cstring>","required":123,"retryAfterSeconds":123}}},"exampleType":"generated"}},"exampleType":"generated"},"94a4f781-4e7b-4f0f-bd52-f20aa941077b":{"description":"Duplicate key or label, or custom-field limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"reason":{"oneOf":[{"type":"string","uniqueKey":"reason.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"reason","typeLabel":"string | null"},"required":{"oneOf":[{"type":"integer","uniqueKey":"required.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"required.oneOf.1","typeLabel":"null"}],"uniqueKey":"required","typeLabel":"integer | null"},"retryAfterSeconds":{"oneOf":[{"type":"integer","uniqueKey":"retryAfterSeconds.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"retryAfterSeconds.oneOf.1","typeLabel":"null"}],"uniqueKey":"retryAfterSeconds","typeLabel":"integer | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>","reason":"\u003cstring>","required":123,"retryAfterSeconds":123}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"8a2126e8-9bac-432f-9f56-c3740489aeeb":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"sk-strand-XXXXXXXXXXXXXXXXXXXXXXXX","scopes":[],"schemeName":"ApiKey"}},"98fbb24f-9a8c-480c-99a8-a0549d6a4dcd":{"OAuth2":{"type":"oauth2","description":"Strand AI authorization-code flow with S256 PKCE, explicit organization consent, and RFC 8707 resource binding.","flows":{"authorizationCode":{"authorizationUrl":"https://auth.strandai.com/oauth2/auth","tokenUrl":"https://auth.strandai.com/oauth2/token","scopes":{"samples:read":"Read slide metadata and estimates","samples:write":"Upload and change slides","jobs:read":"Read run status","jobs:write":"Start, export, or cancel runs","results:read":"Read and download results","credits:spend":"Reserve and spend organization credits"}}},"scopes":[],"schemeName":"OAuth2"}}},"servers":{"d22a4fb9-2508-4e5a-b719-b7d7837b5678":{"url":"https://app.strandai.com/api/v1","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"sk-strand-XXXXXXXXXXXXXXXXXXXXXXXX","scopes":[],"schemeName":"ApiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"},{"schemes":[{"scheme":{"type":"oauth2","description":"Strand AI authorization-code flow with S256 PKCE, explicit organization consent, and RFC 8707 resource binding.","flows":{"authorizationCode":{"authorizationUrl":"https://auth.strandai.com/oauth2/auth","tokenUrl":"https://auth.strandai.com/oauth2/token","scopes":{"samples:read":"Read slide metadata and estimates","samples:write":"Upload and change slides","jobs:read":"Read run status","jobs:write":"Start, export, or cancel runs","results:read":"Read and download results","credits:spend":"Reserve and spend organization credits"}}},"scopes":[],"schemeName":"OAuth2"},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"Strand AI authorization-code flow with S256 PKCE, explicit organization consent, and RFC 8707 resource binding.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"OAuth2","name":"Authorization"}],"title":"OAuth2"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"strandai","siteName":"Strand AI","title":"Create a custom sample field - Strand AI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-04T22:05:46.009Z","originalFileLocation":"api-reference/endpoint/createSampleField.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Strand AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a custom sample field - Strand AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Strand AI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.strandai.com/api-reference/endpoint/createSampleField\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.strandai.com/images/og-card.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a custom sample field - Strand AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.strandai.com/images/og-card.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/strandai/-A6LhR9Q97KZhsDo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Strand AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#004D3B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.strandai.com/api-reference/endpoint/createSampleField\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/createSampleField.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.strandai.com/#organization\",\"name\":\"Strand AI\",\"url\":\"https://docs.strandai.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/strandai/c6Te5vUWVWP-mr0Q/logo-dark.svg?fit=max\u0026auto=format\u0026n=c6Te5vUWVWP-mr0Q\u0026q=85\u0026s=689c0d47abf0f9b5076e963acaffa8d6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.strandai.com#website\",\"name\":\"Strand AI\",\"url\":\"https://docs.strandai.com\",\"publisher\":{\"@id\":\"https://docs.strandai.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField#webpage\",\"url\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField\",\"name\":\"Create a custom sample field\",\"description\":\"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.\",\"dateModified\":\"2026-11-04T22:05:46.009Z\",\"isPartOf\":{\"@id\":\"https://docs.strandai.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.strandai.com/api-reference/endpoint/listMarkers\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a custom sample field\",\"item\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField#apireference\",\"headline\":\"Create a custom sample field\",\"name\":\"Create a custom sample field\",\"description\":\"Create an organization-scoped field definition with an optional description. Credit-free. Requires samples:write.\",\"url\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField\",\"mainEntityOfPage\":{\"@id\":\"https://docs.strandai.com/api-reference/endpoint/createSampleField#webpage\"},\"image\":\"https://docs.strandai.com/images/og-card.png\",\"dateModified\":\"2026-11-04T22:05:46.009Z\",\"publisher\":{\"@id\":\"https://docs.strandai.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.strandai.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Strand AI\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Strand AI","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/quickstart"}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/mcp/overview"}]},{"tab":"API reference","groups":[{"group":"Overview","pages":[{"title":"REST API overview","href":"/api/overview"}]},{"group":"Endpoints","pages":[{"title":"List markers","openapi":"GET /markers","href":"/api-reference/endpoint/listMarkers"},{"title":"List uploads","openapi":"GET /uploads","href":"/api-reference/endpoint/listUploads"},{"title":"Get an upload","openapi":"GET /uploads/{id}","href":"/api-reference/endpoint/getUpload"},{"title":"Initiate upload","openapi":"POST /uploads","href":"/api-reference/endpoint/createUpload"},{"title":"Renew an upload session","openapi":"POST /uploads/{id}","href":"/api-reference/endpoint/renewUploadSession"},{"title":"Price or submit a prediction","openapi":"POST /predict","href":"/api-reference/endpoint/submitPrediction"},{"title":"Get job","openapi":"GET /jobs/{id}","href":"/api-reference/endpoint/getJob"},{"title":"Cancel a job","openapi":"POST /jobs/{id}/cancel","href":"/api-reference/endpoint/cancelJob"},{"title":"Stream job (SSE)","openapi":"GET /jobs/{id}/stream","href":"/api-reference/endpoint/streamJob"},{"title":"Get results URL","openapi":"GET /jobs/{id}/results","href":"/api-reference/endpoint/getJobResults"},{"title":"Download result file","openapi":"GET /jobs/{id}/results/files/{path}","href":"/api-reference/endpoint/getJobResultFile"},{"title":"Read result files in a batch","openapi":"POST /jobs/{id}/results/files","href":"/api-reference/endpoint/getJobResultFilesBatch"},{"title":"Preflight signed result files","openapi":"POST /jobs/{id}/results/files/signed","href":"/api-reference/endpoint/getSignedJobResultFiles"},{"title":"Get an owned or public sample","openapi":"GET /samples/{id}","href":"/api-reference/endpoint/getSample"},{"title":"Update a sample","openapi":"PATCH /samples/{id}","href":"/api-reference/endpoint/patchSample"},{"title":"Request result export","openapi":"POST /jobs/{id}/exports","href":"/api-reference/endpoint/requestResultExport"},{"title":"Get result export","openapi":"GET /jobs/{id}/exports","href":"/api-reference/endpoint/getResultExport"},{"title":"Cell segmentation lifecycle","openapi":"GET /samples/{id}/segmentation","href":"/api-reference/endpoint/sampleSegmentation"},{"title":"Start or retry cell segmentation","openapi":"POST /samples/{id}/segmentation","href":"/api-reference/endpoint/startSampleSegmentation"},{"title":"Get segmentation manifest","openapi":"GET /samples/{id}/segmentation/{layerId}/manifest","href":"/api-reference/endpoint/getSegmentationManifest"},{"title":"Read segmentation artifact file","openapi":"GET /samples/{id}/segmentation/{layerId}/files/{path}","href":"/api-reference/endpoint/getSegmentationFile"},{"title":"Set sample expiration","openapi":"PATCH /samples/{id}/expiration","href":"/api-reference/endpoint/setSampleExpiration"},{"title":"Set sample expiration (bulk)","openapi":"PATCH /samples/expiration","href":"/api-reference/endpoint/setSamplesExpirationBulk"},{"title":"Restore sample","openapi":"POST /samples/{id}/restore","href":"/api-reference/endpoint/restoreSample"},{"title":"List samples","openapi":"GET /samples","href":"/api-reference/endpoint/listSamples"},{"title":"List custom sample fields","description":"Your organization's custom-field definitions, including the ids a `field` filter on List samples binds to. Credit-free.","openapi":"GET /sample-fields","href":"/api-reference/endpoint/listSampleFields"},{"title":"Create a custom sample field","openapi":"POST /sample-fields","href":"/api-reference/endpoint/createSampleField"},{"title":"Publish an artifact","description":"Store an immutable, organization-private HTML case report with provenance and bundled assets.","openapi":"POST /artifacts","href":"/api-reference/endpoint/createArtifact"},{"title":"List artifacts","openapi":"GET /artifacts","href":"/api-reference/endpoint/listArtifacts"},{"title":"Get an artifact","openapi":"GET /artifacts/{id}","href":"/api-reference/endpoint/getArtifact"},{"title":"Delete an artifact","openapi":"DELETE /artifacts/{id}","href":"/api-reference/endpoint/deleteArtifact"},{"title":"Stream a public sample's OME-Zarr","openapi":"GET /public/samples/{publicId}/zarr/{path}","href":"/api-reference/endpoint/getPublicSampleZarr"},{"title":"Get a public sample thumbnail","openapi":"GET /public/samples/{publicId}/thumbnail","href":"/api-reference/endpoint/getPublicSampleThumbnail"}]}]}]},"basePath":"","title":"Create a custom sample field - Strand AI","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C-hEh3I2.js","utils-CnF4QiUD.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C7PVNbel.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-8ytevL2A.js","snippetPresets-BT1alx3v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BLXC0i_W.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CyLIGI9_.js","shallow-DC0lGVIW.js","getApiPlaygroundDisplay-CgDQ85tN.js","CodeSnippet-6-I-Gpv9.js","CodeSnippets-BAk1kDdu.js","Page-C945cI-W.js","getPastedJson-B276RuWN.js","icon-BqP8etTm.js","MethodPill-DM6sbxG1.js","DuplicateIcon-PyJglOaE.js","createIcon-CMeOMAc_.js","DynamicMarkdown-BoyYAA8K.js","SectionHeading-DAYv3gvZ.js","axios-vUo_bRtp.js","Markdown-BhTTmazV.js","clsx-CR-RHrVC.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CBUH0-zX.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BmARFYNC.js"]}