Keys are scoped to an environment — sandbox or production — so you can tell test traffic from live traffic.
Your secret key grants full access to your account. Keep it server-side, never commit it to source control, and never share it in places like Slack or client-side code. The full key is shown only once at creation — if you lose it, revoke it and generate a new one.
A missing or invalid key returns 401 Unauthorized:
{ "error": { "code": "unauthorized", "message": "missing or invalid API key" }}
Idempotency
Write requests — creating a wallet, quoting, or initiating a transfer — require an X-Idempotency-Key header. Send a unique value (a UUID works well) for each distinct operation.
If a request is retried with the same key — after a network error or timeout — Yara returns the original result instead of performing the operation twice. This makes money movement safe to retry.
Generate a fresh idempotency key per operation and reuse it only when retrying that same operation.
Errors
Every error response has the same shape: an error object with a code and a message.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Yara","description":"Yara API documentation for building multi-chain wallets, stablecoin deposits and payouts, customer verification, and USD virtual accounts in Africa.","colors":{"primary":"#665656","light":"#A1908C","dark":"#A1908C"},"logo":{"light":"https://mintcdn.com/yara-0e2696eb/cAYNltdztHVSF-yc/logo/light.svg?fit=max\u0026auto=format\u0026n=cAYNltdztHVSF-yc\u0026q=85\u0026s=0a4e1ebc76bf4791136486252602d8d2","dark":"https://mintcdn.com/yara-0e2696eb/cAYNltdztHVSF-yc/logo/dark.svg?fit=max\u0026auto=format\u0026n=cAYNltdztHVSF-yc\u0026q=85\u0026s=987e0406ce0798428f1a4c2c4b32cf54"},"favicon":"https://mintcdn.com/yara-0e2696eb/cAYNltdztHVSF-yc/favicon.svg?fit=max\u0026auto=format\u0026n=cAYNltdztHVSF-yc\u0026q=85\u0026s=2bf2dc893c29db86bf22e8f96472fd0a","navbar":{"links":[{"href":"https://www.yara.cash","label":"Yara website"},{"href":"mailto:support@yara.cash","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://dashboard.yara.cash"}},"footer":{"socials":{"x":"https://x.com/yaradotcash"}},"seo":{"metatags":{"canonical":"https://developers.yara.cash","twitter:site":"@yaradotcash"}},"fonts":{"family":"Instrument Sans"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"grid-2","href":"https://dashboard.yara.cash"},{"anchor":"Support","icon":"envelope","href":"mailto:support@yara.cash"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"yara-0e2696eb","hasAudioNarration":false,"actualSubdomain":"yara-0e2696eb","customDomains":["developers.yara.cash"],"gitSource":{"type":"github","owner":"yaracash","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aa1834476975f9808f9f3b5","clientVersion":"0.0.4227","searchFilterCounts":[{"language":"default","tag":"Wallets","count":29},{"language":"default","tag":"USD Virtual Accounts","count":17},{"language":"default","tag":"Get started","count":5},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"Transfers","count":5},{"language":"default","tag":"Virtual accounts","count":4},{"language":"default","tag":"Build","count":3},{"language":"default","tag":"Customers and verification","count":3},{"language":"default","tag":"Reference data","count":3},{"language":"default","tag":"Customer verification","count":3}]},"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":"custom-rbac-roles","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":"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":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"get-started/authentication","slug":"/get-started/authentication","pageMetadata":{"title":"How to authenticate Yara API requests","sidebarTitle":"Authentication","description":"Create environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.","keywords":["API key","x-yara-api-key","authentication","idempotency"],"href":"/get-started/authentication"},"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 environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.\"\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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Yara uses API keys to authenticate requests. You generate and manage them in the `,_jsx(_components.a,{href:`https://dashboard.yara.cash`,children:`dashboard`}),` under `,_jsx(_components.strong,{children:`API keys`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`api-keys`,children:`API keys`}),`\n`,_jsxs(_components.p,{children:[`Pass your secret key in the `,_jsx(_components.code,{children:`x-yara-api-key`}),` header on every request.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.yara.cash/v1/wallets \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x-yara-api-key: $YARA_API_KEY\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can also send it as an `,_jsx(_components.code,{children:`Authorization`}),` header if you prefer:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.yara.cash/v1/wallets \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization: ApiKey $YARA_API_KEY\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Keys are scoped to an `,_jsx(_components.a,{href:`/get-started/environments`,children:`environment`}),` — sandbox or production — so you can tell test traffic from live traffic.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Your secret key grants full access to your account. Keep it server-side, never commit it to source control, and never share it in places like Slack or client-side code. The full key is shown `,_jsx(_components.strong,{children:`only once`}),` at creation — if you lose it, revoke it and generate a new one.`]})}),`\n`,_jsxs(_components.p,{children:[`A missing or invalid key returns `,_jsx(_components.code,{children:`401 Unauthorized`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"unauthorized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"missing or invalid API key\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`idempotency`,children:`Idempotency`}),`\n`,_jsxs(_components.p,{children:[`Write requests — creating a wallet, quoting, or initiating a transfer — require an `,_jsx(_components.code,{children:`X-Idempotency-Key`}),` header. Send a unique value (a UUID works well) for each distinct operation.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.yara.cash/v1/transfers \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --request POST \\\\`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x-yara-api-key: $YARA_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-Idempotency-Key: 1f7b2c9a-3d4e-4f5a-9b6c-7d8e9f0a1b2c\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{ \"quote_id\": \"0e0f7b9c-f47b-4f42-b56e-991b8f7a1cb3\" }'`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If a request is retried with the same key — after a network error or timeout — Yara returns the original result instead of performing the operation twice. This makes money movement safe to retry.`}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Generate a fresh idempotency key per operation and reuse it only when retrying that same operation.`})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`Every error response has the same shape: an `,_jsx(_components.code,{children:`error`}),` object with a `,_jsx(_components.code,{children:`code`}),` and a `,_jsx(_components.code,{children:`message`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"validation_error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid JSON body\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{\"data-numeric\":`true`,children:[_jsx(_components.code,{children:`200`}),` / `,_jsx(_components.code,{children:`201`}),` / `,_jsx(_components.code,{children:`202`})]}),_jsx(_components.td,{children:`Success`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:`The request was malformed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:`Missing or invalid API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:`The resource doesn’t exist`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`409`})}),_jsx(_components.td,{children:`Conflict — e.g. a duplicate idempotency key with a different body`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`503`})}),_jsx(_components.td,{children:`A downstream service is temporarily unavailable`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Next, learn how `,_jsx(_components.a,{href:`/get-started/environments`,children:`sandbox and production environments`}),` differ.`]})]})}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":{"config":{},"pageMetadata":{"title":"How to authenticate Yara API requests","sidebarTitle":"Authentication","description":"Create environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.","keywords":["API key","x-yara-api-key","authentication","idempotency"],"href":"/get-started/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"API keys","slug":"api-keys","depth":2,"children":[]},{"title":"Idempotency","slug":"idempotency","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"yara-0e2696eb","siteName":"Yara","title":"How to authenticate Yara API requests - Yara","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-09T16:04:14.898Z","originalFileLocation":"get-started/authentication.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 environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Yara\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"How to authenticate Yara API requests - Yara\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Yara\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.yara.cash/get-started/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://yara-0e2696eb.mintlify.site/_mintlify/api/og/v2?division=Build\u0026amp;title=How+to+authenticate+Yara+API+requests\u0026amp;description=Create+environment-scoped+Yara+API+keys%2C+send+the+x-yara-api-key+header%2C+protect+secrets%2C+and+safely+retry+write+requests+with+idempotency+keys.\u0026amp;theme=3511818ce0cc7ac34cd78997\u0026amp;signature=55f554e0ae29396129178082d675fa508b5fbd380423b6528ffe44b5be92e195\">\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=\"How to authenticate Yara API requests - Yara\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://yara-0e2696eb.mintlify.site/_mintlify/api/og/v2?division=Build\u0026amp;title=How+to+authenticate+Yara+API+requests\u0026amp;description=Create+environment-scoped+Yara+API+keys%2C+send+the+x-yara-api-key+header%2C+protect+secrets%2C+and+safely+retry+write+requests+with+idempotency+keys.\u0026amp;theme=3511818ce0cc7ac34cd78997\u0026amp;signature=55f554e0ae29396129178082d675fa508b5fbd380423b6528ffe44b5be92e195\">\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/yara-0e2696eb/IcFnNFpmjTL8TlzO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Yara\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#665656\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.yara.cash/get-started/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/get-started/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.yara.cash/#organization\",\"name\":\"Yara\",\"url\":\"https://developers.yara.cash\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/yara-0e2696eb/cAYNltdztHVSF-yc/logo/light.svg?fit=max\u0026auto=format\u0026n=cAYNltdztHVSF-yc\u0026q=85\u0026s=0a4e1ebc76bf4791136486252602d8d2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.yara.cash#website\",\"name\":\"Yara\",\"url\":\"https://developers.yara.cash\",\"publisher\":{\"@id\":\"https://developers.yara.cash/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.yara.cash/get-started/authentication#webpage\",\"url\":\"https://developers.yara.cash/get-started/authentication\",\"name\":\"How to authenticate Yara API requests\",\"description\":\"Create environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.\",\"dateModified\":\"2026-09-09T16:04:14.898Z\",\"isPartOf\":{\"@id\":\"https://developers.yara.cash#website\"},\"breadcrumb\":{\"@id\":\"https://developers.yara.cash/get-started/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.yara.cash/get-started/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Build\",\"item\":\"https://developers.yara.cash/get-started/quickstart\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to authenticate Yara API requests\",\"item\":\"https://developers.yara.cash/get-started/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developers.yara.cash/get-started/authentication#article\",\"headline\":\"How to authenticate Yara API requests\",\"name\":\"How to authenticate Yara API requests\",\"description\":\"Create environment-scoped Yara API keys, send the x-yara-api-key header, protect secrets, and safely retry write requests with idempotency keys.\",\"url\":\"https://developers.yara.cash/get-started/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://developers.yara.cash/get-started/authentication#webpage\"},\"dateModified\":\"2026-09-09T16:04:14.898Z\",\"keywords\":\"API key, x-yara-api-key, authentication, idempotency\",\"publisher\":{\"@id\":\"https://developers.yara.cash/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.yara.cash#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Yara\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Yara\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/get-started/authentication.md","siteName":"Yara","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"grid-2","href":"https://dashboard.yara.cash"},{"anchor":"Support","icon":"envelope","href":"mailto:support@yara.cash"}]},"tabs":[{"tab":"Get started","groups":[{"group":"Introduction","pages":[{"title":"Yara API documentation for wallets and USD accounts","sidebarTitle":"Build with Yara","mode":"wide","href":""},{"title":"Yara developer platform for stablecoin infrastructure","sidebarTitle":"What is Yara?","href":"/get-started/what-is-yara"}]},{"group":"Build","pages":[{"title":"Yara API quickstart: create a wallet and payout","sidebarTitle":"Quickstart","description":"Create a multi-chain wallet, receive a stablecoin deposit into your USD balance, quote a payout, and initiate your first Yara transfer.","href":"/get-started/quickstart"},{"title":"How to authenticate Yara API requests","sidebarTitle":"Authentication","href":"/get-started/authentication"},{"title":"Yara API sandbox and production environments","sidebarTitle":"Environments","description":"Test with sandbox API keys, understand environment isolation, and move your Yara integration to production without changing the API base URL.","href":"/get-started/environments"}]}]},{"tab":"Wallets","pages":[{"title":"Wallets","href":"/wallets/overview"}]},{"tab":"Ramps","pages":[{"title":"Ramps","href":"/ramps/overview"}]},{"tab":"USD Virtual Accounts","pages":[{"title":"USD Virtual Accounts","href":"/virtual-accounts/overview"}]},{"tab":"Liquidity","pages":[{"title":"Liquidity","href":"/liquidity/overview"}]}]},"basePath":"","title":"How to authenticate Yara API requests - Yara","deploymentId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","buildId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","dynamics":[],"chunks":[]}