Por ahora las API Keys se crean desde la API. La pantalla para gestionarlas
desde el panel está en desarrollo.
Necesitas una cuenta en Factio con rol de administrador o
propietario y el registro de tu empresa completo.1. Inicia sesión con tu email y contraseña para obtener un token temporal:
La respuesta incluye access_token. Si tu usuario pertenece a varias empresas,
agrega "tenant_id" en el body para elegir con cuál trabajar.2. Crea la API Key con ese token:
Copia api_key inmediatamente: no se muestra de nuevo. Las keys tienen el
formato fac_ seguido de 64 caracteres hexadecimales.Puedes listar tus keys con GET /auth/api-keys y revocar una con
DELETE /auth/api-keys/{key_id}, usando el mismo token.
Nunca incluyas tu API key en código fuente o repositorios.
Usa variables de entorno o un gestor de secretos.
Si una key queda expuesta, revócala de inmediato.
Cada key pertenece a una sola empresa. El ambiente del SRI (pruebas o
producción) no depende de la key sino del emisor: consulta Entornos.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Factio","colors":{"primary":"#0F6FFF","light":"#3B8EFF","dark":"#0047CC"},"logo":{"light":"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/logo/factio-light.svg?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=9425e17ca9555aa016ad9333f09072b1","dark":"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/logo/factio-dark.svg?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=c8a58d6e201fc17ea18bbb93f40fc6c4","href":"https://factioapp.com"},"favicon":"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=dc2a0f2d4bdcdd41c0a99318ba4a6413","api":{"playground":{"display":"interactive"}},"variables":{"API_PRODUCTION_URL":"https://api.factioapp.com","API_STAGING_URL":"https://api.staging.factioapp.com","APP_DOMAIN":"https://factioapp.com","WEB_DOMAIN":"https://factioapp.com","DOCS_DOMAIN":"https://docs.factioapp.com"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"me-94224791","hasAudioNarration":false,"actualSubdomain":"me-94224791","customDomains":["docs.factioapp.com"],"gitSource":{"type":"github","owner":"rommel96","repo":"factio-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adadc96fa05280e66cb96eb","collectionId":"3a57dcf4-8616-4b38-a4ba-be618591770d","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adadc96fa05280e66cb96eb"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adadc96fa05280e66cb96eb","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Referencia API","count":88},{"language":"default","tag":"Authentication","count":21},{"language":"default","tag":"documents","count":21},{"language":"default","tag":"Guías","count":17},{"language":"default","tag":"establishments","count":11},{"language":"default","tag":"Buyers","count":8},{"language":"default","tag":"issuers","count":8},{"language":"default","tag":"tenant","count":6},{"language":"default","tag":"certificates","count":5},{"language":"default","tag":"Products","count":5}]},"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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"authentication","slug":"/authentication","pageMetadata":{"title":"Autenticación","description":"Cómo autenticar tus requests a la API de Factio","href":"/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: \"Cómo autenticar tus requests a la API de Factio\"\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`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Las integraciones se autentican con una `,_jsx(_components.strong,{children:`API Key`}),` en el header `,_jsx(_components.code,{children:`X-API-Key`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`obtener-tu-api-key`,children:`Obtener tu API Key`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Por ahora las API Keys se crean desde la API. La pantalla para gestionarlas\ndesde el panel está en desarrollo.`})}),`\n`,_jsxs(_components.p,{children:[`Necesitas una cuenta en `,_jsx(_components.a,{href:`https://factioapp.com`,children:`Factio`}),` con rol de administrador o\npropietario y el registro de tu empresa completo.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`1. Inicia sesión`}),` con tu email y contraseña para obtener un token temporal:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.factioapp.com/auth/login`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"email\": \"[email protected]\", \"password\": \"TU_CONTRASEÑA\"}'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`La respuesta incluye `,_jsx(_components.code,{children:`access_token`}),`. Si tu usuario pertenece a varias empresas,\nagrega `,_jsx(_components.code,{children:`\"tenant_id\"`}),` en el body para elegir con cuál trabajar.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`2. Crea la API Key`}),` con ese token:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.factioapp.com/auth/api-keys`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer TU_ACCESS_TOKEN\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"name\": \"ERP Producción\"}'`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,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:`7`,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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"6b1f0c2e-1d4a-4f7b-9a3e-2c8d5e7f9a10\"`}),_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:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ERP Producción\"`}),_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:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fac_...\"`}),_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:` \"key_prefix\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fac_3f2\"`}),_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:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-20T15:30:00Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Copia `,_jsx(_components.code,{children:`api_key`}),` inmediatamente: `,_jsx(_components.strong,{children:`no se muestra de nuevo`}),`. Las keys tienen el\nformato `,_jsx(_components.code,{children:`fac_`}),` seguido de 64 caracteres hexadecimales.`]}),`\n`,_jsxs(_components.p,{children:[`Puedes listar tus keys con `,_jsx(_components.code,{children:`GET /auth/api-keys`}),` y revocar una con\n`,_jsx(_components.code,{children:`DELETE /auth/api-keys/{key_id}`}),`, usando el mismo token.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Nunca incluyas tu API key en código fuente o repositorios.`}),`\nUsa variables de entorno o un gestor de secretos.\nSi una key queda expuesta, revócala de inmediato.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`cómo-incluir-la-api-key-en-tus-requests`,children:`Cómo incluir la API Key en tus requests`}),`\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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.factioapp.com/issuers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: fac_TU_API_KEY\"`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` httpx`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` httpx.Client(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.factioapp.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-API-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fac_TU_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`60`}),_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(_components.p,{children:[`Cada key pertenece a una sola empresa. El ambiente del SRI (pruebas o\nproducción) no depende de la key sino del emisor: consulta `,_jsx(_components.a,{href:`/environments`,children:`Entornos`}),`.`]})]})}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":"Autenticación","description":"Cómo autenticar tus requests a la API de Factio","href":"/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Obtener tu API Key","slug":"obtener-tu-api-key","depth":2,"children":[]},{"title":"Cómo incluir la API Key en tus requests","slug":"cómo-incluir-la-api-key-en-tus-requests","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"me-94224791","siteName":"Factio","title":"Autenticación - Factio","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T04:03:41.389Z","originalFileLocation":"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=\"Cómo autenticar tus requests a la API de Factio\">\u003cmeta data-mint-head name=\"application-name\" content=\"Factio\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003cmeta data-mint-head property=\"og:title\" content=\"Autenticación - Factio\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cómo autenticar tus requests a la API de Factio\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Factio\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.factioapp.com/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://me-94224791.mintlify.app/_mintlify/api/og/v2?division=Introducci%C3%B3n\u0026amp;title=Autenticaci%C3%B3n\u0026amp;description=C%C3%B3mo+autenticar+tus+requests+a+la+API+de+Factio\u0026amp;theme=e04c22958a665de58c7f2931\u0026amp;signature=1a9c9f2dbd1a74d16320eeca73b5ea8114be9b85195835d2d7af8fe376927aaa\">\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=\"Autenticación - Factio\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cómo autenticar tus requests a la API de Factio\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://me-94224791.mintlify.app/_mintlify/api/og/v2?division=Introducci%C3%B3n\u0026amp;title=Autenticaci%C3%B3n\u0026amp;description=C%C3%B3mo+autenticar+tus+requests+a+la+API+de+Factio\u0026amp;theme=e04c22958a665de58c7f2931\u0026amp;signature=1a9c9f2dbd1a74d16320eeca73b5ea8114be9b85195835d2d7af8fe376927aaa\">\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=\"https://mintlify.s3.us-west-1.amazonaws.com/me-94224791/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Factio\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F6FFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.factioapp.com/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.factioapp.com/#organization\",\"name\":\"Factio\",\"url\":\"https://docs.factioapp.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/logo/factio-light.svg?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=9425e17ca9555aa016ad9333f09072b1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.factioapp.com#website\",\"name\":\"Factio\",\"url\":\"https://docs.factioapp.com\",\"publisher\":{\"@id\":\"https://docs.factioapp.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.factioapp.com/authentication#webpage\",\"url\":\"https://docs.factioapp.com/authentication\",\"name\":\"Autenticación\",\"description\":\"Cómo autenticar tus requests a la API de Factio\",\"dateModified\":\"2026-10-23T04:03:41.389Z\",\"isPartOf\":{\"@id\":\"https://docs.factioapp.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.factioapp.com/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.factioapp.com/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Introducción\",\"item\":\"https://docs.factioapp.com/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Autenticación\",\"item\":\"https://docs.factioapp.com/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.factioapp.com/authentication#article\",\"headline\":\"Autenticación\",\"name\":\"Autenticación\",\"description\":\"Cómo autenticar tus requests a la API de Factio\",\"url\":\"https://docs.factioapp.com/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://docs.factioapp.com/authentication#webpage\"},\"dateModified\":\"2026-10-23T04:03:41.389Z\",\"publisher\":{\"@id\":\"https://docs.factioapp.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.factioapp.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Factio\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Factio","nav":{"global":null,"tabs":[{"tab":"Guías","groups":[{"group":"Introducción","pages":[{"title":"Bienvenido a Factio","href":"/introduction"},{"title":"Quickstart","description":"Emite tu primera factura en el ambiente de pruebas del SRI","href":"/quickstart"},{"title":"Autenticación","href":"/authentication"},{"title":"Entornos","description":"Ambiente de pruebas y de producción del SRI","href":"/environments"}]},{"group":"Conceptos clave","pages":[{"title":"Ciclo de vida de un comprobante","href":"/sri-lifecycle"},{"title":"Idempotencia","href":"/idempotency"},{"title":"Manejo de errores","href":"/errors"}]},{"group":"Guías","pages":[{"title":"Emitir Factura","href":"/guides/emit-invoice"},{"title":"Emitir Nota de Crédito","href":"/guides/emit-credit-note"},{"title":"Consultar Estado","href":"/guides/check-status"},{"title":"Subir Certificado","href":"/guides/upload-certificate"},{"title":"Manejar Rechazos","href":"/guides/handle-rejections"}]}]},{"tab":"Referencia API","pages":[{"title":"Referencia API","href":"/api-reference/authentication/google-oauth-callback"}]}]},"basePath":"","title":"Autenticación - Factio","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}