{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key",
"details": "The provided API key is invalid or has been revoked"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key",
"details": "The provided API key is invalid or has been revoked"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key",
"details": "The provided API key is invalid or has been revoked"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key",
"details": "The provided API key is invalid or has been revoked"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key",
"details": "The provided API key is invalid or has been revoked"
}
}
Endpoints
Get Failed Attacks
Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.
You can find a tenant’s Petra ID in the URL when viewing a tenant in the dashboard (e.g. app.petrasecurity.com/tenant/<tenantId>). You can also pass a Microsoft tenant ID and the endpoint will resolve it automatically.
The tenant to generate the report for. Accepts either a Petra tenant ID or a Microsoft tenant ID. You can find a tenant's Petra ID in the URL when viewing a tenant in the dashboard (e.g. app.petrasecurity.com/tenant/). You can also pass a Microsoft tenant ID and the endpoint will resolve it automatically.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Petra Security Docs","colors":{"primary":"#AE6654","light":"#E1C09E","dark":"#AE6654"},"logo":{"light":"https://mintcdn.com/petrasecurity-7f411ce9/xhwggn1Webj24oba/logo/light-group.svg?fit=max\u0026auto=format\u0026n=xhwggn1Webj24oba\u0026q=85\u0026s=bcb6096cc95673da0210cd35cab62266","dark":"https://mintcdn.com/petrasecurity-7f411ce9/xhwggn1Webj24oba/logo/dark-group.svg?fit=max\u0026auto=format\u0026n=xhwggn1Webj24oba\u0026q=85\u0026s=291d7abdafea5c702cded7e0ccfe9109"},"favicon":"https://mintcdn.com/petrasecurity-7f411ce9/804PMvzD5nFDNqZk/favicon.png?fit=max\u0026auto=format\u0026n=804PMvzD5nFDNqZk\u0026q=85\u0026s=e8b9e056a6422ed2998faf9649a268c0","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"}},"navbar":{"links":[{"href":"https://www.petrasecurity.com/research","label":"Research"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.petrasecurity.com"}},"seo":{"metatags":{"canonical":"https://www.petrasecurity.com/docs","robots":"index, follow"}},"integrations":{"posthog":{"apiKey":"phc_9Nbz8UiN0da62l0QMCrMSFxEprCHPQzLeDmUhMF9hG8"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Research","icon":"newspaper","href":"https://www.petrasecurity.com/research"},{"anchor":"Support","icon":"envelope","href":"mailto:support@petrasecurity.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"petrasecurity-7f411ce9","hasAudioNarration":false,"actualSubdomain":"petrasecurity-7f411ce9","customDomains":["docs.petrasecurity.com"],"gitSource":{"type":"github","owner":"petra-security","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae4e2512a1bb30bba7f9d4e","collectionId":"26fd9ddb-1597-4165-85b5-1a0804c9f857","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae4e2512a1bb30bba7f9d4e"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aee63006689ddcee8208579","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Guides","count":43},{"language":"default","tag":"How to","count":32},{"language":"default","tag":"Get Started","count":9},{"language":"default","tag":"API Reference","count":9},{"language":"default","tag":"Settings","count":8},{"language":"default","tag":"Investigate","count":7},{"language":"default","tag":"Reporting","count":7},{"language":"default","tag":"Endpoints","count":6},{"language":"default","tag":"Integrations","count":4},{"language":"default","tag":"API Documentation","count":3}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":false},"customCss":[],"page":{"pagePath":"api-reference/endpoints/get-failed-attacks","slug":"/api-reference/endpoints/get-failed-attacks","pageMetadata":{"title":"Get Failed Attacks","openapi":"GET /v1/failed-attacks","description":"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.","href":"/api-reference/endpoints/get-failed-attacks"},"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: \"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.\"\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`,strong:`strong`,..._provideComponents(),...props.components},{Note}=_components;if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsxs(Note,{children:[`For common API errors, see `,_jsx(_components.a,{href:`/api-reference/troubleshooting`,children:`API Troubleshooting`}),`.`]}),`\n`,_jsxs(Note,{children:[`This route is limited to `,_jsx(_components.strong,{children:`1 request per minute`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`You can find a tenant’s Petra ID in the URL when viewing a tenant in the dashboard (e.g. `,_jsx(_components.code,{children:`app.petrasecurity.com/tenant/\u003ctenantId>`}),`). You can also pass a Microsoft tenant ID and the endpoint will resolve it automatically.`]})]})}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":"Get Failed Attacks","openapi":"GET /v1/failed-attacks","description":"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.","href":"/api-reference/endpoints/get-failed-attacks"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Get failed attacks","description":"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.","tags":[],"operationId":"getFailedAttacks","parameters":["cd737849-31e5-4301-b920-2e1ca4b8cca3","ccb832e6-3141-491d-9e14-08110742c3c5","5be80209-2e30-4a21-ac27-04c876f02df2"],"responses":{"200":"cd63c579-58ee-4911-abb7-c9f8cb62dbea","400":"e3f872d7-00c4-40d2-9ce7-1b2023f91b3b","401":"60a4f764-7d71-470f-9650-81d7ef1675c5","404":"612ec696-05b4-45bf-8748-754e94e65ed1","429":"7ea0204b-af75-4f5e-bde5-0f8f1eee8806","500":"ab9026b4-97b1-4c7e-97e9-b7f6f907dbb4"},"security":["d83128d4-bdc7-4c76-b71e-552dd05f379a"],"method":"get","type":"path","servers":["85e9853c-be4d-489c-ae3d-0804cd5ea855"],"path":"/v1/failed-attacks","baseUrlOptions":["https://api.petrasecurity.com"],"title":"Get failed attacks","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"cd737849-31e5-4301-b920-2e1ca4b8cca3":{"name":"tenantId","in":"query","required":true,"description":"The tenant to generate the report for. Accepts either a Petra tenant ID or a Microsoft tenant ID. You can find a tenant's Petra ID in the URL when viewing a tenant in the dashboard (e.g. app.petrasecurity.com/tenant/\u003ctenantId>). You can also pass a Microsoft tenant ID and the endpoint will resolve it automatically.","schema":{"type":"string","isRequired":true,"description":"The tenant to generate the report for. Accepts either a Petra tenant ID or a Microsoft tenant ID. You can find a tenant's Petra ID in the URL when viewing a tenant in the dashboard (e.g. app.petrasecurity.com/tenant/\u003ctenantId>). You can also pass a Microsoft tenant ID and the endpoint will resolve it automatically.","uniqueKey":"","typeLabel":"string"}},"ccb832e6-3141-491d-9e14-08110742c3c5":{"name":"startDate","in":"query","required":false,"description":"Start of the reporting window. Accepts ISO 8601 date or date-time (e.g. 2026-03-01 or 2026-03-01T00:00:00Z). Defaults to 30 days before endDate.","schema":{"type":"string","format":"date-time","isRequired":false,"description":"Start of the reporting window. Accepts ISO 8601 date or date-time (e.g. 2026-03-01 or 2026-03-01T00:00:00Z). Defaults to 30 days before endDate.","uniqueKey":"","typeLabel":"string\u003cdate-time>"}},"5be80209-2e30-4a21-ac27-04c876f02df2":{"name":"endDate","in":"query","required":false,"description":"End of the reporting window. Accepts ISO 8601 date or date-time. Defaults to now.","schema":{"type":"string","format":"date-time","isRequired":false,"description":"End of the reporting window. Accepts ISO 8601 date or date-time. Defaults to now.","uniqueKey":"","typeLabel":"string\u003cdate-time>"}}},"responses":{"cd63c579-58ee-4911-abb7-c9f8cb62dbea":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"dateRange":{"type":"object","properties":{"startDate":{"type":"string","format":"date-time","description":"Start of the reporting window (ISO 8601)","uniqueKey":"dateRange.startDate","typeLabel":"string\u003cdate-time>"},"endDate":{"type":"string","format":"date-time","description":"End of the reporting window (ISO 8601)","uniqueKey":"dateRange.endDate","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"dateRange","typeLabel":"object"},"tenant":{"type":"object","description":"The tenant this report covers","properties":{"petraTenantId":{"type":"string","description":"The Petra tenant ID","uniqueKey":"tenant.petraTenantId","typeLabel":"string"},"name":{"type":"string","description":"The tenant display name","uniqueKey":"tenant.name","typeLabel":"string"},"microsoftTenantId":{"type":"string","description":"The Microsoft tenant ID","uniqueKey":"tenant.microsoftTenantId","typeLabel":"string"}},"uniqueKey":"tenant","typeLabel":"object"},"totalCount":{"type":"integer","description":"Total number of failed attacks in the window","uniqueKey":"totalCount","typeLabel":"integer"},"byCountry":{"type":"array","description":"Failed attacks grouped by origin country","items":{"type":"object","properties":{"name":{"oneOf":[{"type":"string","description":"Human-readable country name (e.g. Russia)","uniqueKey":"byCountry.items.[INDEX].name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Human-readable country name (e.g. Russia)","uniqueKey":"byCountry.items.[INDEX].name.oneOf.1","typeLabel":"null"}],"uniqueKey":"byCountry.items.[INDEX].name","typeLabel":"string | null"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code (e.g. RU)","uniqueKey":"byCountry.items.[INDEX].countryCode","typeLabel":"string"},"count":{"type":"integer","uniqueKey":"byCountry.items.[INDEX].count","typeLabel":"integer"}},"uniqueKey":"byCountry.items.[INDEX]","typeLabel":"object"},"uniqueKey":"byCountry","typeLabel":"object[]"},"byDay":{"type":"array","description":"Daily breakdown of failed attacks grouped by attack type","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","uniqueKey":"byDay.items.[INDEX].date","typeLabel":"string\u003cdate-time>"},"byType":{"type":"array","items":{"type":"object","properties":{"attackType":{"type":"string","enum":["PIERCING_HORNET","FRANTIC_HORNET","HURRICANE_HORNET","LEGACY_AUTH","NODE_FETCH","PYTHON","AZURE_ACOM","AZURE_AD_CONNECT","AZURE_IDS_AUTH_PROVIDER","IDS_LOCKED","PASSWORD_SPRAY"],"description":"The type of attack detected","uniqueKey":"byDay.items.[INDEX].byType.items.[INDEX].attackType","typeLabel":"enum\u003cstring>"},"count":{"type":"integer","uniqueKey":"byDay.items.[INDEX].byType.items.[INDEX].count","typeLabel":"integer"}},"uniqueKey":"byDay.items.[INDEX].byType.items.[INDEX]","typeLabel":"object"},"uniqueKey":"byDay.items.[INDEX].byType","typeLabel":"object[]"}},"uniqueKey":"byDay.items.[INDEX]","typeLabel":"object"},"uniqueKey":"byDay","typeLabel":"object[]"},"topTargetedUsers":{"type":"array","description":"Users most targeted by failed attacks","items":{"type":"object","properties":{"userPrincipalName":{"type":"string","description":"User's email address (UPN)","uniqueKey":"topTargetedUsers.items.[INDEX].userPrincipalName","typeLabel":"string"},"fullName":{"oneOf":[{"type":"string","uniqueKey":"topTargetedUsers.items.[INDEX].fullName.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"topTargetedUsers.items.[INDEX].fullName.oneOf.1","typeLabel":"null"}],"uniqueKey":"topTargetedUsers.items.[INDEX].fullName","typeLabel":"string | null"},"jobTitle":{"oneOf":[{"type":"string","uniqueKey":"topTargetedUsers.items.[INDEX].jobTitle.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"topTargetedUsers.items.[INDEX].jobTitle.oneOf.1","typeLabel":"null"}],"uniqueKey":"topTargetedUsers.items.[INDEX].jobTitle","typeLabel":"string | null"},"count":{"type":"integer","uniqueKey":"topTargetedUsers.items.[INDEX].count","typeLabel":"integer"},"attackOriginCountries":{"type":"array","description":"Countries the attacks originated from","items":{"type":"object","properties":{"name":{"oneOf":[{"type":"string","description":"Human-readable country name","uniqueKey":"topTargetedUsers.items.[INDEX].attackOriginCountries.items.[INDEX].name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Human-readable country name","uniqueKey":"topTargetedUsers.items.[INDEX].attackOriginCountries.items.[INDEX].name.oneOf.1","typeLabel":"null"}],"uniqueKey":"topTargetedUsers.items.[INDEX].attackOriginCountries.items.[INDEX].name","typeLabel":"string | null"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code","uniqueKey":"topTargetedUsers.items.[INDEX].attackOriginCountries.items.[INDEX].countryCode","typeLabel":"string"}},"uniqueKey":"topTargetedUsers.items.[INDEX].attackOriginCountries.items.[INDEX]","typeLabel":"object"},"uniqueKey":"topTargetedUsers.items.[INDEX].attackOriginCountries","typeLabel":"object[]"}},"uniqueKey":"topTargetedUsers.items.[INDEX]","typeLabel":"object"},"uniqueKey":"topTargetedUsers","typeLabel":"object[]"}},"example":{"dateRange":{"startDate":"2025-01-05T00:00:00.000Z","endDate":"2025-02-25T00:00:00.000Z"},"tenant":{"petraTenantId":"ZZk90t","name":"Acme Corp.","microsoftTenantId":"a1b2c3d4-5e6f-7890-abcd-ef1234567890"},"totalCount":50471,"byCountry":[{"name":"United States","countryCode":"US","count":11501},{"name":"China","countryCode":"CN","count":11349},{"name":"South Korea","countryCode":"KR","count":5184}],"byDay":[{"date":"2025-01-05T00:00:00.000Z","byType":[{"attackType":"LEGACY_AUTH","count":11}]},{"date":"2025-01-06T00:00:00.000Z","byType":[{"attackType":"LEGACY_AUTH","count":66},{"attackType":"PASSWORD_SPRAY","count":30}]},{"date":"2025-01-07T00:00:00.000Z","byType":[{"attackType":"LEGACY_AUTH","count":97},{"attackType":"PASSWORD_SPRAY","count":42}]}],"topTargetedUsers":[{"userPrincipalName":"pink.jones@acmecorp.com","fullName":"Pink Jones","jobTitle":"Sales Representative","count":4463,"attackOriginCountries":[{"name":"India","countryCode":"IN"},{"name":"United Arab Emirates","countryCode":"AE"},{"name":"Portugal","countryCode":"PT"}]},{"userPrincipalName":"solon.doyle@acmecorp.com","fullName":"Solon Doyle","jobTitle":"Network Engineer","count":2519,"attackOriginCountries":[{"name":"China","countryCode":"CN"},{"name":"Russia","countryCode":"RU"},{"name":"South Korea","countryCode":"KR"}]},{"userPrincipalName":"annabel.ankunding@acmecorp.com","fullName":"Annabel Ankunding","jobTitle":"Sales Manager","count":2466,"attackOriginCountries":[{"name":"France","countryCode":"FR"},{"name":"Germany","countryCode":"DE"},{"name":"Spain","countryCode":"ES"}]}]},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"dateRange":{"startDate":"2025-01-05T00:00:00.000Z","endDate":"2025-02-25T00:00:00.000Z"},"tenant":{"petraTenantId":"ZZk90t","name":"Acme Corp.","microsoftTenantId":"a1b2c3d4-5e6f-7890-abcd-ef1234567890"},"totalCount":50471,"byCountry":[{"name":"United States","countryCode":"US","count":11501},{"name":"China","countryCode":"CN","count":11349},{"name":"South Korea","countryCode":"KR","count":5184}],"byDay":[{"date":"2025-01-05T00:00:00.000Z","byType":[{"attackType":"LEGACY_AUTH","count":11}]},{"date":"2025-01-06T00:00:00.000Z","byType":[{"attackType":"LEGACY_AUTH","count":66},{"attackType":"PASSWORD_SPRAY","count":30}]},{"date":"2025-01-07T00:00:00.000Z","byType":[{"attackType":"LEGACY_AUTH","count":97},{"attackType":"PASSWORD_SPRAY","count":42}]}],"topTargetedUsers":[{"userPrincipalName":"pink.jones@acmecorp.com","fullName":"Pink Jones","jobTitle":"Sales Representative","count":4463,"attackOriginCountries":[{"name":"India","countryCode":"IN"},{"name":"United Arab Emirates","countryCode":"AE"},{"name":"Portugal","countryCode":"PT"}]},{"userPrincipalName":"solon.doyle@acmecorp.com","fullName":"Solon Doyle","jobTitle":"Network Engineer","count":2519,"attackOriginCountries":[{"name":"China","countryCode":"CN"},{"name":"Russia","countryCode":"RU"},{"name":"South Korea","countryCode":"KR"}]},{"userPrincipalName":"annabel.ankunding@acmecorp.com","fullName":"Annabel Ankunding","jobTitle":"Sales Manager","count":2466,"attackOriginCountries":[{"name":"France","countryCode":"FR"},{"name":"Germany","countryCode":"DE"},{"name":"Spain","countryCode":"ES"}]}]}}},"exampleType":"generated"}},"exampleType":"generated"},"e3f872d7-00c4-40d2-9ce7-1b2023f91b3b":{"description":"Bad Request - Invalid startDate or endDate","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"string","description":"Additional error details","uniqueKey":"error.details","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"example":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}}}},"exampleType":"generated"}},"exampleType":"generated"},"60a4f764-7d71-470f-9650-81d7ef1675c5":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"string","description":"Additional error details","uniqueKey":"error.details","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"example":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}}}},"exampleType":"generated"}},"exampleType":"generated"},"612ec696-05b4-45bf-8748-754e94e65ed1":{"description":"Not Found - The specified tenant was not found in your organization","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"string","description":"Additional error details","uniqueKey":"error.details","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"example":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}}}},"exampleType":"generated"}},"exampleType":"generated"},"7ea0204b-af75-4f5e-bde5-0f8f1eee8806":{"description":"Too Many Requests - Rate limit exceeded for this route","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"string","description":"Additional error details","uniqueKey":"error.details","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"example":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}}}},"exampleType":"generated"}},"exampleType":"generated"},"ab9026b4-97b1-4c7e-97e9-b7f6f907dbb4":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error code","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"string","description":"Additional error details","uniqueKey":"error.details","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"example":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"UNAUTHORIZED","message":"Invalid API key","details":"The provided API key is invalid or has been revoked"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"d83128d4-bdc7-4c76-b71e-552dd05f379a":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication. Include your API key in the Authorization header as 'Bearer YOUR_API_KEY'","scopes":[]}}},"servers":{"85e9853c-be4d-489c-ae3d-0804cd5ea855":{"url":"https://api.petrasecurity.com","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Bearer token authentication. Include your API key in the Authorization header as 'Bearer YOUR_API_KEY'","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer token authentication. Include your API key in the Authorization header as 'Bearer YOUR_API_KEY'","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"petrasecurity-7f411ce9","siteName":"Petra Security Docs","title":"Get Failed Attacks - Petra Security Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-27T03:36:49.657Z","originalFileLocation":"api-reference/endpoints/get-failed-attacks.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=\"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Petra Security Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_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=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Get Failed Attacks - Petra Security Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Petra Security Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://petrasecurity-7f411ce9.mintlify.site/docs/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Get+Failed+Attacks\u0026amp;description=Retrieve+failed-attack+data+for+a+specific+tenant.+Returns+attack+counts+by+country%2C+daily+attack+breakdowns+by+type%2C+and+the+most+targeted+users+for+the+reques\u0026amp;theme=31c2f7c2d5d7b20c1ba92feb\u0026amp;signature=ed32bcf34912b6b4c2bbfd07afa05c1add6d2051d79229074f15ede17d42cc63\">\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=\"Get Failed Attacks - Petra Security Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://petrasecurity-7f411ce9.mintlify.site/docs/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Get+Failed+Attacks\u0026amp;description=Retrieve+failed-attack+data+for+a+specific+tenant.+Returns+attack+counts+by+country%2C+daily+attack+breakdowns+by+type%2C+and+the+most+targeted+users+for+the+reques\u0026amp;theme=31c2f7c2d5d7b20c1ba92feb\u0026amp;signature=ed32bcf34912b6b4c2bbfd07afa05c1add6d2051d79229074f15ede17d42cc63\">\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=\"/docs/mintlify-assets/_mintlify/favicons/petrasecurity-7f411ce9/cyxbo4YDwlRH7S8y/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Petra Security Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#AE6654\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/endpoints/get-failed-attacks.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.petrasecurity.com/#organization\",\"name\":\"Petra Security Docs\",\"url\":\"https://www.petrasecurity.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/petrasecurity-7f411ce9/xhwggn1Webj24oba/logo/light-group.svg?fit=max\u0026auto=format\u0026n=xhwggn1Webj24oba\u0026q=85\u0026s=bcb6096cc95673da0210cd35cab62266\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.petrasecurity.com/docs#website\",\"name\":\"Petra Security Docs\",\"url\":\"https://www.petrasecurity.com/docs\",\"publisher\":{\"@id\":\"https://www.petrasecurity.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks#webpage\",\"url\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks\",\"name\":\"Get Failed Attacks\",\"description\":\"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.\",\"dateModified\":\"2026-05-27T03:36:49.657Z\",\"isPartOf\":{\"@id\":\"https://www.petrasecurity.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-tenants\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Failed Attacks\",\"item\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks#apireference\",\"headline\":\"Get Failed Attacks\",\"name\":\"Get Failed Attacks\",\"description\":\"Retrieve failed-attack data for a specific tenant. Returns attack counts by country, daily attack breakdowns by type, and the most targeted users for the requested date range.\",\"url\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks\",\"mainEntityOfPage\":{\"@id\":\"https://www.petrasecurity.com/docs/api-reference/endpoints/get-failed-attacks#webpage\"},\"dateModified\":\"2026-05-27T03:36:49.657Z\",\"publisher\":{\"@id\":\"https://www.petrasecurity.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.petrasecurity.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Petra Security Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Petra Security Docs","nav":{"global":{"anchors":[{"anchor":"Research","icon":"newspaper","href":"https://www.petrasecurity.com/research"},{"anchor":"Support","icon":"envelope","href":"mailto:support@petrasecurity.com"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/welcome"}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"API Troubleshooting","href":"/api-reference/troubleshooting"}]},{"group":"Endpoints","pages":[{"title":"Get Tenants","openapi":"GET /v1/tenants","href":"/api-reference/endpoints/get-tenants"},{"title":"Get Usage","openapi":"GET /v1/usage","href":"/api-reference/endpoints/get-usage"},{"title":"Get Billable Users","openapi":"GET /v1/billable-users","href":"/api-reference/endpoints/get-billable-users"},{"title":"Get Incidents","openapi":"GET /v1/incidents","description":"Retrieve security incidents ordered by creation date (newest first).","href":"/api-reference/endpoints/get-incidents"},{"title":"Get Failed Attacks","openapi":"GET /v1/failed-attacks","href":"/api-reference/endpoints/get-failed-attacks"},{"title":"Get Posture Reports","openapi":"GET /v1/posture-reports","description":"Retrieve completed Microsoft 365 security posture reports for the tenants in your organization. By default this returns the most recent completed report for each tenant, newest first. Each report includes the score and grade, a rollup of control results, the Global Administrators review, the top risks, and every individual check with its status, severity, current state, and suggested fix. Results reflect any edits made to the report in the Petra dashboard, so they match the PDF your clients see.","href":"/api-reference/endpoints/get-posture-reports"}]}]}]},"basePath":"","title":"Get Failed Attacks - Petra Security Docs","buildId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","deploymentId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CNqlzjVB.js","utils-BqFiXZ79.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CnR4QBe6.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BY2ZM1OO.js","snippetPresets-x-8ACO8V.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ch-SJE05.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CqqG_0NE.js","shallow-BXrZ2b0C.js","getApiPlaygroundDisplay-n7J_wkjq.js","CodeSnippet-CQsp4vyQ.js","CodeSnippets-BfuHqvZx.js","Page-CTxrMSpo.js","getPastedJson-BjrGIK1i.js","icon-7iLZnVOC.js","MethodPill-TBS1m84e.js","DuplicateIcon-BNMrV4Vs.js","createIcon-C5kCqeU2.js","DynamicMarkdown-Bq09mRwR.js","SectionHeading-G4Bflf5Q.js","axios-vUo_bRtp.js","Markdown-BTUds0aX.js","clsx-6wHzaN2_.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BPypQKlo.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-o6bee4ro.js"]}