{"componentChunkName":"component---src-templates-docs-js","path":"/pt-pt/integrations/api-keys","result":{"data":{"site":{"siteMetadata":{"title":"Documentation | PostNext","docsLocation":""}},"mdx":{"fields":{"id":"1687b61f-0d27-5efa-ac0d-4f236fdc53cf","title":"Chaves de API","slug":"/pt-pt/integrations/api-keys","locale":"pt-PT"},"body":"var _excluded = [\"components\"];\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"Chaves de API\",\n  \"metaTitle\": \"Chaves de API e Acesso | PostNext\",\n  \"metaDescription\": \"Crie chaves de API e autentique pedidos à API do PostNext com o cabeçalho x-api-key a partir das definições da conta.\",\n  \"order\": 3\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", null, \"Chaves de API\"), mdx(\"p\", null, \"Use chaves de API para autenticar pedidos program\\xE1ticos \\xE0 API do PostNext. Gira as suas chaves em \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://postnext.io/account/api-keys\"\n  }, \"postnext.io/account/api-keys\"), \".\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"800px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/docs/static/b8afb753a718961a2110b52e89529085/644c5/account.jpg\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"62.5%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAEF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAcQWQH//xAAWEAEBAQAAAAAAAAAAAAAAAAAQEQD/2gAIAQEAAQUCYTf/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAaEAEAAwADAAAAAAAAAAAAAAABABFBECFh/9oACAEBAAE/IUlJrFdbnTZXvD//2gAMAwEAAgADAAAAEOTf/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAHBABAQACAgMAAAAAAAAAAAAAAREAIVGhMWFx/9oACAEBAAE/ENhNXi4MYCFGzENRcrctU2PWLfPTPrrP/9k=')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"As Account Settings do PostNext com o cartão API Keys nas opções de faturação e acesso\",\n    \"title\": \"As Account Settings do PostNext com o cartão API Keys nas opções de faturação e acesso\",\n    \"src\": \"/docs/static/b8afb753a718961a2110b52e89529085/4b190/account.jpg\",\n    \"srcSet\": [\"/docs/static/b8afb753a718961a2110b52e89529085/e07e9/account.jpg 200w\", \"/docs/static/b8afb753a718961a2110b52e89529085/066f9/account.jpg 400w\", \"/docs/static/b8afb753a718961a2110b52e89529085/4b190/account.jpg 800w\", \"/docs/static/b8afb753a718961a2110b52e89529085/e5166/account.jpg 1200w\", \"/docs/static/b8afb753a718961a2110b52e89529085/644c5/account.jpg 1440w\"],\n    \"sizes\": \"(max-width: 800px) 100vw, 800px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"h2\", null, \"Criar uma chave de API\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Aceda a \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://postnext.io/account/api-keys\"\n  }, \"postnext.io/account/api-keys\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Crie uma nova chave e copie-a imediatamente. A chave completa s\\xF3 \\xE9 apresentada uma vez.\")), mdx(\"h2\", null, \"Autenticar pedidos\"), mdx(\"p\", null, \"Inclua a sua chave de API em cada pedido usando o cabe\\xE7alho \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"x-api-key\"), \":\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"curl -H \\\"x-api-key: YOUR_KEY\\\" https://postnext.io/api/...\\n\")), mdx(\"p\", null, \"Todas as respostas da API s\\xE3o em JSON.\"), mdx(\"h2\", null, \"Manter as chaves seguras\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"N\\xE3o guarde chaves em controlo de vers\\xF5es nem as exponha em c\\xF3digo do lado do cliente.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Se uma chave for exposta, elimine-a imediatamente em \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://postnext.io/account/api-keys\"\n  }, \"postnext.io/account/api-keys\"), \" e crie uma substituta.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Use uma chave por integra\\xE7\\xE3o para poder rodar ou revogar chaves individuais sem afetar as outras.\")));\n}\n;\nMDXContent.isMDXComponent = true;","rawBody":"---\ntitle: \"Chaves de API\"\nmetaTitle: \"Chaves de API e Acesso | PostNext\"\nmetaDescription: \"Crie chaves de API e autentique pedidos à API do PostNext com o cabeçalho x-api-key a partir das definições da conta.\"\norder: 3\n---\n\n# Chaves de API\n\nUse chaves de API para autenticar pedidos programáticos à API do PostNext. Gira as suas chaves em [postnext.io/account/api-keys](https://postnext.io/account/api-keys).\n\n![As Account Settings do PostNext com o cartão API Keys nas opções de faturação e acesso](../images/docs/account.jpg)\n\n## Criar uma chave de API\n\n1. Aceda a [postnext.io/account/api-keys](https://postnext.io/account/api-keys).\n2. Crie uma nova chave e copie-a imediatamente. A chave completa só é apresentada uma vez.\n\n## Autenticar pedidos\n\nInclua a sua chave de API em cada pedido usando o cabeçalho `x-api-key`:\n\n```bash\ncurl -H \"x-api-key: YOUR_KEY\" https://postnext.io/api/...\n```\n\nTodas as respostas da API são em JSON.\n\n## Manter as chaves seguras\n\n- Não guarde chaves em controlo de versões nem as exponha em código do lado do cliente.\n- Se uma chave for exposta, elimine-a imediatamente em [postnext.io/account/api-keys](https://postnext.io/account/api-keys) e crie uma substituta.\n- Use uma chave por integração para poder rodar ou revogar chaves individuais sem afetar as outras.\n","tableOfContents":{"items":[{"url":"#chaves-de-api","title":"Chaves de API","items":[{"url":"#criar-uma-chave-de-api","title":"Criar uma chave de API"},{"url":"#autenticar-pedidos","title":"Autenticar pedidos"},{"url":"#manter-as-chaves-seguras","title":"Manter as chaves seguras"}]}]},"parent":{"__typename":"File","relativePath":"pt-pt/integrations/api-keys.md"},"frontmatter":{"metaTitle":"Chaves de API e Acesso | PostNext","metaDescription":"Crie chaves de API e autentique pedidos à API do PostNext com o cabeçalho x-api-key a partir das definições da conta.","order":3}},"allMdx":{"edges":[{"node":{"fields":{"slug":"/pt-pt/features","title":"Funcionalidades"}}},{"node":{"fields":{"slug":"/pt-pt/integrations","title":"Integrações"}}},{"node":{"fields":{"slug":"/pt-pt/mini-site","title":"Mini Site"}}},{"node":{"fields":{"slug":"/pt-pt/guides","title":"Guias"}}},{"node":{"fields":{"slug":"/pt-pt/content-planners","title":"Planeadores de Conteúdo"}}},{"node":{"fields":{"slug":"/pt-pt/pricing-faqs","title":"FAQs de Preços"}}},{"node":{"fields":{"slug":"/pt-pt/knowledge-base","title":"Base de Conhecimento"}}},{"node":{"fields":{"slug":"/pt-pt/content-planners/influencer-planner","title":"Influencer Plans"}}},{"node":{"fields":{"slug":"/pt-pt/content-planners/post-planner","title":"Post Planner"}}},{"node":{"fields":{"slug":"/pt-pt/features/ai-content","title":"Conteúdo com AI"}}},{"node":{"fields":{"slug":"/pt-pt/features/ai-carousels","title":"Carrosséis com AI"}}},{"node":{"fields":{"slug":"/pt-pt/features/analytics","title":"Analytics"}}},{"node":{"fields":{"slug":"/pt-pt/content-planners/brand-planner","title":"Brand Plans"}}},{"node":{"fields":{"slug":"/pt-pt/features/brand-profile","title":"Perfil de Marca"}}},{"node":{"fields":{"slug":"/pt-pt/features/channels","title":"Canais"}}},{"node":{"fields":{"slug":"/pt-pt/features/post-composer","title":"Post Composer"}}},{"node":{"fields":{"slug":"/pt-pt/features/apps","title":"Apps"}}},{"node":{"fields":{"slug":"/pt-pt/guides/teams-and-brand-profiles","title":"Equipas e Perfis de Marca"}}},{"node":{"fields":{"slug":"/pt-pt/features/asset-management","title":"Gestão de Recursos"}}},{"node":{"fields":{"slug":"/pt-pt/integrations/api-keys","title":"Chaves de API"}}},{"node":{"fields":{"slug":"/pt-pt/integrations/mcp","title":"MCP (Agentes de AI)"}}},{"node":{"fields":{"slug":"/pt-pt/integrations/wordpress","title":"WordPress"}}},{"node":{"fields":{"slug":"/pt-pt/guides/connect-your-first-channel","title":"Ligar o Primeiro Canal"}}},{"node":{"fields":{"slug":"/pt-pt/knowledge-base/how-to-update-card-details","title":"Como Atualizar os Dados do Cartão"}}},{"node":{"fields":{"slug":"/pt-pt/features/scheduling","title":"Agendamento"}}},{"node":{"fields":{"slug":"/pt-pt/guides/create-your-first-post","title":"Criar a Primeira Publicação"}}},{"node":{"fields":{"slug":"/pt-pt/knowledge-base/understanding-declined-card-payments","title":"Perceber Pagamentos com Cartão Recusados"}}},{"node":{"fields":{"slug":"/pt-pt/guides/plan-your-content","title":"Planear o Conteúdo"}}},{"node":{"fields":{"slug":"/pt-pt/guides/schedule-and-publish","title":"Agendar e Publicar"}}},{"node":{"fields":{"slug":"/pt-pt/knowledge-base/managing-your-plan-and-limits","title":"Gerir o Seu Plano e Limites"}}},{"node":{"fields":{"slug":"/pt-pt","title":"Documentação PostNext"}}},{"node":{"fields":{"slug":"/pt-pt/features/post-composer/creating-and-editing-drafts","title":"Criar e Editar Rascunhos"}}},{"node":{"fields":{"slug":"/pt-pt/features/scheduling/best-time-to-post","title":"Melhor Horário para Publicar"}}}]}},"pageContext":{"id":"1687b61f-0d27-5efa-ac0d-4f236fdc53cf","locale":"pt-PT"}},"staticQueryHashes":["361965504","361965504","417421954","417421954","445494767","445494767"]}