{"openapi":"3.1.0","info":{"title":"FRA Digital Financial Disclosure API","version":"1.4.0","summary":"Filing, status, reference data and public data API of the Financial Regulatory Authority (Egypt).","description":"Server-to-server API of the FRA disclosure platform.\n\n* **Authentication** — OAuth 2.0 client credentials (`POST /oauth/token`) gives a Bearer token valid 1 hour, limited to the client's scopes.\n* **Encrypted filings** — payloads are encrypted with AES-256-GCM, the key wrapped with RSA-OAEP under the FRA public key (`GET /public-key`), and the ciphertext signed by the client (RSA PKCS#1 v1.5, SHA-256).\n* **Idempotency** — every POST/PUT on the filing API (Bearer-authenticated) **must** carry an `Idempotency-Key` header (400 `idempotency_key_required` otherwise, sandbox included); other POSTs accept it. A retry with the same key and body replays the first response for 24 hours.\n* **Mutual TLS** — production connections to the authenticated API must present the client certificate registered with the FRA for the API client (403 `client_certificate_required` / `_mismatch` / `_expired` / `_revoked` / `_not_registered`). Sandbox credentials are exempt.\n* **Quotas** — each API client has its own per-minute and per-day quota; every response carries `X-RateLimit-Limit/-Remaining/-Reset` (minute) and `X-RateLimit-Day-*`; over quota → 429 `rate_limit_exceeded` with `Retry-After`.\n* **Sandbox** — sandbox credentials (self-service in the company portal) use the same base URL; responses carry `X-FRA-Environment: sandbox` and nothing reaches FRA review.\n* **Public data** — `/facts`, `/statistics/*`, `/xbrl/*` need no authentication.","contact":{"name":"FRA Disclosure Platform","url":"https://fra2.corprise.ai/developers"}},"servers":[{"url":"https://fra2.corprise.ai/api/v1","description":"Production and sandbox (the credential decides)"}],"tags":[{"name":"Authentication","description":"OAuth 2.0 client credentials. Tokens are opaque, valid for 3600 s, and carry a subset of the client's scopes."},{"name":"Keys","description":"FRA transport public key (to encrypt) and the client's own signing key (to rotate)."},{"name":"Filings","description":"Channel A — an encrypted XBRL/iXBRL instance; Channel B — figures by field_key/concept in the same envelope; extraction mappings; status and listing."},{"name":"Attachments","description":"Encrypted supporting documents for an existing filing."},{"name":"XBRL test filing","description":"Pre-validation of an XBRL report against every FRA rule layer, without filing anything (XB-IN-005)."},{"name":"Disclosure envelope","description":"Canonical signed disclosure envelope (event-driven disclosures, IR platform)."},{"name":"Templates","description":"Disclosure templates (models), their fields, XBRL concepts and validators."},{"name":"Taxonomies","description":"XBRL taxonomies and their concepts."},{"name":"Reference data","description":"Deadlines and the official reporting calendar of the authenticated company."},{"name":"Onboarding","description":"Access requests and key-regeneration requests (no credentials needed)."},{"name":"Rules","description":"Canonical rules and decrees registry, and stateless rule evaluation."},{"name":"Public statistics","description":"Aggregate statistics — public, cached hourly."},{"name":"Public data","description":"Facts of accepted filings, bulk files and XBRL reference data — public, cacheable."},{"name":"Agency data sharing","description":"Aggregates for partner agencies under a data-sharing agreement (X-API-Key)."},{"name":"Compliance","description":"Compliance score history."},{"name":"Health","description":"Liveness/readiness probes for load balancers and monitoring."},{"name":"Portal extraction","description":"Endpoints used by the company portal's own pages (logged-in session + CSRF), documented for completeness."},{"name":"Developer","description":"This document."},{"name":"Filing agents","description":"Third-party filing agents (accounting firms, filing service providers) acting for many companies. An agent's OAuth client belongs to the agent, not to a company: on every company-level call (the ordinary filing, status, template endpoints) send `X-FRA-Company` (company UUID or FRA licence number) and `X-FRA-Agent-User-Token` (the agent staff member's personal token, expiring after 30 days by default). The call is allowed only while that company's authorisation of the agent is in force and covers the capability it exercises (view, prepare, submit — `filing:submit` prepares a draft; `metadata.submit: true` or Channel A submits); otherwise 403 `agent_not_authorised` / `capability_not_authorised` / `template_not_authorised` / `period_not_authorised` / `segregation_of_duties`, 400 `company_required`, 401 `user_token_required` / `invalid_user_token`. Client secrets expire (365 days by default) and are rotated with POST /agent/client/rotate-secret."},{"name":"MCP","description":"Model Context Protocol server (bring-your-own AI): JSON-RPC 2.0 over the Streamable HTTP transport. Read-only tools: search_filings, get_filing_facts, get_validation_results, get_taxonomy_element, list_entry_points, compare_filings. OAuth API clients with scope `mcp:read` see public data (accepted filings); FRA staff with a personal token see public data and their portfolio. See docs/api/MCP.md for client configuration."}],"paths":{"/access-requests":{"post":{"operationId":"createAccessRequest","tags":["Onboarding"],"summary":"Request API access","description":"An IR platform or company asks the FRA for credentials. One pending request per contact email. The FRA answers by webhook (`access_request.approved` / `rejected`) when `webhook_url` is given; poll /access-requests/{id}/status otherwise.","x-rate-limit":"5/min","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"responses":{"201":{"description":"Request recorded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestCreated"}}}},"409":{"description":"A request from this email is already pending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"x-idempotent":true}},"/access-requests/key-regeneration":{"post":{"operationId":"requestKeyRegeneration","tags":["Onboarding"],"summary":"Request new client credentials","description":"For a client that lost its secret. The email must belong to a user of the client's company or to the original requester.","x-rate-limit":"3/min","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"contact_email":{"type":"string","format":"email"},"reason":{"type":"string","maxLength":1000}},"required":["client_id","contact_email","reason"]}}}},"responses":{"201":{"description":"Request recorded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestCreated"}}}},"404":{"description":"No active client with this client_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Email does not match the client.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"x-idempotent":true}},"/access-requests/{id}/status":{"get":{"operationId":"getAccessRequestStatus","tags":["Onboarding"],"summary":"Status of an access request","description":"The contact email must match. Once approved, `credentials.client_id` is included (the secret is delivered out of band).","x-rate-limit":"30/min","security":[],"parameters":[{"name":"id","in":"path","required":true,"description":"Request id.","schema":{"type":"integer"}},{"name":"email","in":"query","required":true,"description":"Contact email of the request.","schema":{"type":"string","format":"email"}}],"responses":{"200":{"description":"Status.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestStatus"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/agency/compliance-aggregates":{"get":{"operationId":"agencyComplianceAggregates","tags":["Agency data sharing"],"summary":"Compliance aggregates","description":"Status totals, 6-month trend and sector compliance rates. Requires an active data-sharing agreement; access is logged.","x-rate-limit":"30/min","security":[{"agencyApiKey":[]}],"responses":{"200":{"description":"Aggregates.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Aggregates.","additionalProperties":true},"generated_at":{"type":"string","format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/agency/filing-timeline":{"get":{"operationId":"agencyFilingTimeline","tags":["Agency data sharing"],"summary":"Filing timeline","description":"Submitted / accepted / rejected / pending per month, last 12 months. Requires an active data-sharing agreement; access is logged.","x-rate-limit":"30/min","security":[{"agencyApiKey":[]}],"responses":{"200":{"description":"Aggregates.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Aggregates.","additionalProperties":true},"generated_at":{"type":"string","format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/agency/sector-stats":{"get":{"operationId":"agencySectorStats","tags":["Agency data sharing"],"summary":"Sector statistics","description":"Active companies, filings and acceptance per sector this year. Requires an active data-sharing agreement; access is logged.","x-rate-limit":"30/min","security":[{"agencyApiKey":[]}],"responses":{"200":{"description":"Aggregates.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Aggregates.","additionalProperties":true},"generated_at":{"type":"string","format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/client/public-key":{"put":{"operationId":"rotateClientKey","tags":["Keys"],"summary":"Replace the client's RSA signing public key","description":"Registers a new RSA public key (PEM, ≥ 2048 bits) used to verify the client's signatures. Requires scope `client:key_rotate`. Audited.","x-rate-limit":"5/min","security":[{"fraOAuth":["client:key_rotate"],"mutualTLS":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rsa_public_key":{"type":"string","description":"PEM-encoded RSA public key (min. 200 characters)."}},"required":["rsa_public_key"]}}}},"responses":{"200":{"description":"Key replaced.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"422":{"description":"Not an RSA key of at least 2048 bits, or validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-idempotent":true}},"/companies/{id}/compliance-history":{"get":{"operationId":"getComplianceHistory","tags":["Compliance"],"summary":"Compliance score history of a company","description":"A client reads only its own company unless its token holds `compliance:read_all`.","x-rate-limit":"60/min","security":[{"fraOAuth":[],"mutualTLS":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Company (tenant) id.","schema":{"type":"string"}},{"name":"months","in":"query","description":"Window when from/to are absent.","schema":{"type":"integer","minimum":1,"maximum":60,"default":12}},{"name":"from","in":"query","description":"Start date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"End date.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"History.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceHistory"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/deadlines":{"get":{"operationId":"listDeadlines","tags":["Reference data"],"summary":"Filing deadlines of the company","description":"Pending and overdue by default.","x-rate-limit":"60/min","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"status","in":"query","description":"Only this status.","schema":{"type":"string","enum":["pending","filed","overdue","waived"]}},{"name":"include_past","in":"query","description":"Include deadlines older than 30 days.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Deadlines.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeadlineList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/decrees":{"get":{"operationId":"listDecrees","tags":["Rules"],"summary":"Decrees registry","description":"Decrees and circulars the rules cite.","x-rate-limit":"120/min (shared api limiter)","security":[],"responses":{"200":{"description":"Decrees.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Decree"}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/decrees/{id}":{"get":{"operationId":"getDecree","tags":["Rules"],"summary":"One decree","description":"","x-rate-limit":"120/min (shared api limiter)","security":[],"parameters":[{"name":"id","in":"path","required":true,"description":"Decree id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Decree.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Decree"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/disclosures":{"post":{"operationId":"submitDisclosureEnvelope","tags":["Disclosure envelope"],"summary":"Submit a signed disclosure envelope","description":"Canonical JSON envelope signed by the issuer certificate (`signatures.issuer_sig` over the canonical JSON without `signatures`). `submitted_at` must be within ±5 minutes of FRA time; `audit.ir_validation_hash`, when present, must match FRA's re-hash of figures/quotes/promises. FRA rules are evaluated on receipt and returned as `flags`. Not available to sandbox credentials (403 `sandbox_unsupported`).","x-rate-limit":"120/min (shared api limiter)","security":[{"fraOAuth":["filing:submit"],"mutualTLS":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureEnvelope"}}}},"responses":{"201":{"description":"Received.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureReceived"}}}},"422":{"description":"Rejected: `error` is schema | signature | integrity | duplicate | …","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-idempotent":true}},"/disclosures/{trackingId}/status":{"get":{"operationId":"getDisclosureStatus","tags":["Disclosure envelope"],"summary":"Status of a disclosure envelope","description":"Tenant-isolated: only the issuer's own disclosures.","x-rate-limit":"120/min (shared api limiter)","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"trackingId","in":"path","required":true,"description":"ULID returned as `tracking_id`.","schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"}}],"responses":{"200":{"description":"Status.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/extraction-jobs/{job_id}":{"get":{"operationId":"extractionJob","tags":["Portal extraction"],"summary":"An extraction job with its results","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"description":"Extraction job id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Job.","content":{"application/json":{"schema":{"type":"object","description":"Job.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/extraction-jobs/{job_id}/export-xbrl":{"post":{"operationId":"extractionJobExportXbrl","tags":["Portal extraction"],"summary":"Export a job's figures as XBRL","description":"Session + CSRF token.","security":[{"portalSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"job_id","in":"path","required":true,"description":"Extraction job id.","schema":{"type":"string"}}],"responses":{"200":{"description":"XBRL document.","content":{"application/xml":{"schema":{"type":"string"}}},"headers":{"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"x-idempotent":true}},"/extraction-jobs/{job_id}/retry":{"post":{"operationId":"extractionJobRetry","tags":["Portal extraction"],"summary":"Retry a failed extraction job","description":"Session + CSRF token.","security":[{"portalSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"job_id","in":"path","required":true,"description":"Extraction job id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Re-queued.","content":{"application/json":{"schema":{"type":"object","description":"Result.","additionalProperties":true}}},"headers":{"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"x-idempotent":true}},"/extraction-jobs/{job_id}/status":{"get":{"operationId":"extractionJobStatus","tags":["Portal extraction"],"summary":"Progress of an extraction job","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"description":"Extraction job id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","description":"Status, progress.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/extraction/formats":{"get":{"operationId":"extractionFormats","tags":["Portal extraction"],"summary":"Supported upload formats","description":"Public.","x-rate-limit":"60/min","security":[],"responses":{"200":{"description":"Formats.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","description":"Formats and limits.","additionalProperties":true}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/extractions/export-csv":{"get":{"operationId":"extractionExportCsv","tags":["Portal extraction"],"summary":"Export the job list as CSV","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"filename","in":"query","description":"File name contains.","schema":{"type":"string"}},{"name":"status","in":"query","description":"Job status.","schema":{"type":"string"}},{"name":"confirmation_status","in":"query","description":"approved | rejected | pending.","schema":{"type":"string"}},{"name":"format","in":"query","description":"pdf, xlsx…","schema":{"type":"string"}},{"name":"language","in":"query","description":"ar | en.","schema":{"type":"string"}},{"name":"date_from","in":"query","description":"From.","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","description":"To.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"CSV.","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/extractions/filter-options":{"get":{"operationId":"extractionFilterOptions","tags":["Portal extraction"],"summary":"Filter values for the search UI","description":"","security":[{"portalSession":[]}],"responses":{"200":{"description":"Options.","content":{"application/json":{"schema":{"type":"object","description":"Options.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/extractions/history":{"get":{"operationId":"extractionHistory","tags":["Portal extraction"],"summary":"Extraction jobs of the company","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","maximum":100}},{"name":"offset","in":"query","description":"Offset.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Jobs.","content":{"application/json":{"schema":{"type":"object","description":"success, data[], total.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/extractions/search":{"get":{"operationId":"extractionSearch","tags":["Portal extraction"],"summary":"Search extraction jobs","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"filename","in":"query","description":"File name contains.","schema":{"type":"string"}},{"name":"status","in":"query","description":"Job status.","schema":{"type":"string"}},{"name":"confirmation_status","in":"query","description":"approved | rejected | pending.","schema":{"type":"string"}},{"name":"format","in":"query","description":"pdf, xlsx…","schema":{"type":"string"}},{"name":"language","in":"query","description":"ar | en.","schema":{"type":"string"}},{"name":"date_from","in":"query","description":"From.","schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","description":"To.","schema":{"type":"string","format":"date"}},{"name":"filing_id","in":"query","description":"Filing.","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Sort column.","schema":{"type":"string"}},{"name":"direction","in":"query","description":"Direction.","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Results.","content":{"application/json":{"schema":{"type":"object","description":"success, data[], pagination.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/extractions/stats":{"get":{"operationId":"extractionFilterStats","tags":["Portal extraction"],"summary":"Counts per filter value","description":"","security":[{"portalSession":[]}],"responses":{"200":{"description":"Stats.","content":{"application/json":{"schema":{"type":"object","description":"Stats.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/extractions/suggestions":{"get":{"operationId":"extractionSuggestions","tags":["Portal extraction"],"summary":"Search suggestions","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"query","in":"query","description":"Prefix.","schema":{"type":"string"}},{"name":"type","in":"query","description":"filename (default).","schema":{"type":"string"}}],"responses":{"200":{"description":"Suggestions.","content":{"application/json":{"schema":{"type":"object","description":"Suggestions.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/extractions/summary-stats":{"get":{"operationId":"extractionSummaryStats","tags":["Portal extraction"],"summary":"Extraction statistics of the company","description":"","security":[{"portalSession":[]}],"responses":{"200":{"description":"Stats.","content":{"application/json":{"schema":{"type":"object","description":"Stats.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/facts":{"get":{"operationId":"listFacts","tags":["Public data"],"summary":"Facts of accepted filings","description":"Every XBRL fact of every filing the FRA accepted — never drafts, filings under review, rejected filings or sandbox data. Filters combine with AND; list-valued filters accept comma-separated values. Responses are cached (`Cache-Control: public`) and carry an `ETag`; send `If-None-Match` to get 304. Bulk files: /facts/bulk.","x-rate-limit":"60/min","security":[],"parameters":[{"name":"concept","in":"query","description":"Concept QName(s), e.g. ifrs-full:Revenue.","schema":{"type":"string"}},{"name":"company","in":"query","description":"FRA licence number(s) or LEI(s).","schema":{"type":"string"}},{"name":"sector","in":"query","description":"Sector code(s).","schema":{"type":"string"}},{"name":"fiscal_year","in":"query","description":"Fiscal year(s) of the filing.","schema":{"type":"string","pattern":"^\\d{4}(,\\d{4})*$"}},{"name":"period","in":"query","description":"Annual (FY) or quarter.","schema":{"type":"string","enum":["FY","Q1","Q2","Q3","Q4"]}},{"name":"period_context","in":"query","description":"Current period or comparative.","schema":{"type":"string","enum":["current","prior"]}},{"name":"statement","in":"query","description":"Statement code(s), e.g. SFP, PL.","schema":{"type":"string"}},{"name":"filing","in":"query","description":"Filing reference number(s).","schema":{"type":"string"}},{"name":"page","in":"query","description":"Page.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},{"name":"If-None-Match","in":"header","description":"ETag of a previous response.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of facts.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"ETag":{"$ref":"#/components/headers/ETag"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactPage"}}}},"304":{"description":"Not modified (If-None-Match matched)."},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/facts/bulk":{"get":{"operationId":"listBulkFiles","tags":["Public data"],"summary":"Daily bulk files","description":"Gzipped CSV and xBRL-JSON (OIM 1.0) per fiscal year, regenerated daily, with row counts and SHA-256. Data dictionary: /open-data/bulk.","x-rate-limit":"60/min","security":[],"responses":{"200":{"description":"Files.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkFileList"}}}},"304":{"description":"Not modified."},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/filings":{"get":{"operationId":"listFilings","tags":["Filings"],"summary":"List the company's filings","description":"Newest first, 20 per page. A sandbox client sees only its sandbox filings.","x-rate-limit":"60/min","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"status","in":"query","description":"Filter by status, e.g. draft, submitted, accepted.","schema":{"type":"string"}},{"name":"period","in":"query","description":"Substring of the period label, e.g. 2025.","schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"A page of filings.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilingList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/filings/from-extraction":{"post":{"operationId":"submitExtraction","tags":["Filings"],"summary":"Create a draft from extracted line items (plain JSON)","description":"For IR systems that extracted the statements themselves: items are mapped to the template by label. High-confidence, fully-matched mappings become a `draft`; otherwise `mapping_review`. Not encrypted — prefer Channel B for figures by field.","x-rate-limit":"30/min","security":[{"fraOAuth":["filing:submit"],"mutualTLS":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FromExtractionRequest"}}}},"responses":{"201":{"description":"Draft created with its mapping summary.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionMappingResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-idempotent":true}},"/filings/structured":{"post":{"operationId":"submitStructuredFiling","tags":["Filings"],"summary":"Submit figures by field (Channel B, encrypted)","description":"The decrypted plaintext is JSON (`StructuredFilingPayload`, format `fra-structured-json-v1`): each figure names its template field by `field_key`, or by an XBRL `concept` that exactly one field carries. An unknown key, an ambiguous concept or a non-number refuses the whole filing with the list (`invalid_figures`) — nothing is guessed. Totals are re-checked and differences reported as `warnings`, never corrected.\n\nCreated as a draft for the company to review and seal; with `metadata.submit: true` it goes to the FRA when every readiness gate passes (else 422 `submission_not_ready`, the draft is kept).\n\n**Sandbox**: `submit: true` runs the real data checklist and simulates the review.","x-rate-limit":"30/min","security":[{"fraOAuth":["filing:submit"],"mutualTLS":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructuredFilingRequest"}}}},"responses":{"201":{"description":"Stored (draft) or received.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructuredFilingResult"}}}},"422":{"description":"Validation, unknown template, envelope failure, invalid payload, unbindable figures, or not ready.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InvalidFigures"},{"$ref":"#/components/schemas/SubmissionNotReady"},{"$ref":"#/components/schemas/ApiError"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"409":{"description":"This exact payload was already submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"},"400":{"$ref":"#/components/responses/BadRequest"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-idempotent":true}},"/filings/submit":{"post":{"operationId":"submitXbrlFiling","tags":["Filings"],"summary":"Submit an encrypted XBRL / iXBRL filing (Channel A)","description":"The plaintext is the XBRL report: Inline XBRL (one document, or a document set inside a report package), XBRL 2.1, xBRL-JSON, or a report package (`.xbri`/`.xbr`/`.zip`, sent as its raw ZIP bytes). The platform verifies the signature, decrypts, checks `metadata.checksum_sha256` against the decrypted bytes, then reads the report through **Channel D intake**: a report that references an FRA entry point (or any package / xBRL-JSON) is validated as filed — package safety, XBRL conformance (Arelle, offline), Calculations 1.1, duplicates, FRA filing rules, data quality — and refused with 422 `xbrl_validation_failed` and the full `validation` report (`XbrlValidationReport`) on any error; nothing is filed then. Its facts are bound to the template by element, period and dimensions. The response carries `xbrl_mode: standard` and `xbrl_validation`.\n\n**Legacy mode** (`xbrl_mode: legacy_dynamic_fields`): a document without an FRA entry point — the IR platform's `fra:DynamicField_N` facts — is still read by label as before while the FRA keeps `XBRL_API_LEGACY_MODE=allow`; with `reject` it is refused (422 `legacy_format_rejected`). Validate before filing with POST /xbrl/test-filing.\n\nThe filing is then stored, and the readiness gates run (checklist, attestation, internal approval). Ready → submitted to the FRA (201, `status: received`); not ready → kept as a draft the company completes in the portal (422 `submission_not_ready` with `blocking`).\n\nOptional `attachments[]` are additional encrypted files (e.g. the signed PDF) in the same envelope format, virus-scanned before storage.\n\nThe exact same ciphertext can be submitted only once (409 `duplicate_submission`); use an Idempotency-Key to retry safely.\n\n**Sandbox**: the review is simulated (`sandbox: true`, `simulated_status`); `metadata.sandbox_outcome` chooses the simulated decision.","x-rate-limit":"30/min","security":[{"fraOAuth":["filing:submit"],"mutualTLS":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XbrlFilingRequest"}}}},"responses":{"201":{"description":"Received and submitted to the FRA (sandbox: simulated).","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilingReceived"}}}},"422":{"description":"Validation failed, unknown template, decryption/signature/checksum failure, key version not found, XBRL report refused (xbrl_validation_failed, template_mismatch, legacy_format_rejected), or not ready (stored as draft).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SubmissionNotReady"},{"$ref":"#/components/schemas/XbrlValidationFailed"},{"$ref":"#/components/schemas/ApiError"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"409":{"description":"This exact payload was already submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"},"400":{"$ref":"#/components/responses/BadRequest"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-idempotent":true}},"/filings/{filing_id}/confirm-extraction":{"put":{"operationId":"confirmExtraction","tags":["Portal extraction"],"summary":"Approve or reject an extraction","description":"Session + CSRF token.","security":[{"portalSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"filing_id","in":"path","required":true,"description":"Disclosure submission id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"confirmation_status":{"type":"string","enum":["approved","rejected"]},"notes":{"type":["string","null"],"maxLength":1000},"figures":{"type":"array","items":{"type":"object","description":"Corrected figure.","additionalProperties":true}}},"required":["job_id","confirmation_status"]}}}},"responses":{"200":{"description":"Recorded.","content":{"application/json":{"schema":{"type":"object","description":"Result.","additionalProperties":true}}},"headers":{"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"x-idempotent":true}},"/filings/{filing_id}/extract":{"post":{"operationId":"extractFromUpload","tags":["Portal extraction"],"summary":"Upload a statement file to extract","description":"Multipart upload (PDF, XLSX, XLS, CSV, DOCX; ≤ 100 MB). Session + CSRF token.","x-rate-limit":"20/min","security":[{"portalSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"filing_id","in":"path","required":true,"description":"Disclosure submission id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Statement file.","contentMediaType":"application/octet-stream"},"language":{"type":"string","enum":["ar","en"]},"confidence_threshold":{"type":"number","minimum":0.7,"maximum":0.95}},"required":["file"]}}}},"responses":{"202":{"description":"Queued.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"type":"object","description":"job_id, status.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"x-idempotent":true}},"/filings/{filing_id}/extraction-preview":{"get":{"operationId":"extractionPreview","tags":["Portal extraction"],"summary":"Preview extracted figures of a filing","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"filing_id","in":"path","required":true,"description":"Disclosure submission id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview.","content":{"application/json":{"schema":{"type":"object","description":"Preview.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/filings/{filing_id}/extraction-status":{"get":{"operationId":"extractionStatusForFiling","tags":["Portal extraction"],"summary":"Extraction status of a filing","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"filing_id","in":"path","required":true,"description":"Disclosure submission id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","description":"Status.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/filings/{filing_id}/extractions":{"get":{"operationId":"filingExtractions","tags":["Portal extraction"],"summary":"Extraction jobs of a filing","description":"","security":[{"portalSession":[]}],"parameters":[{"name":"filing_id","in":"path","required":true,"description":"Disclosure submission id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Jobs.","content":{"application/json":{"schema":{"type":"object","description":"Jobs.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/filings/{reference}/attachments":{"post":{"operationId":"uploadAttachment","tags":["Attachments"],"summary":"Add an encrypted attachment to a filing","description":"Same envelope as the filing. The decrypted bytes must match `checksum_sha256`, pass the virus scan and the content-type sniffing. Refused for finalized (accepted/rejected) filings.","x-rate-limit":"20/min","security":[{"fraOAuth":["filing:submit"],"mutualTLS":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"},{"name":"reference","in":"path","required":true,"description":"Filing reference number, e.g. FRA-2025-E-00042.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentRequest"}}}},"responses":{"201":{"description":"Stored.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentReceived"}}}},"422":{"description":"Validation, decryption, checksum, scan, or finalized filing.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ApiError"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/ServerError"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"x-idempotent":true}},"/filings/{reference}/figures":{"get":{"operationId":"getFilingFigures","tags":["Filings"],"summary":"Extracted figures with source position and verdict","description":"The figures read from the company's own filing, each with its source position (page, row, bounding box) and — once data reconciliation has run — its verdict (read correctly / corrected with evidence / suspect / unreadable) and the evidence it rests on (DI-011, DI-031). Text-only items are left out.","x-rate-limit":"60/min","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"reference","in":"path","required":true,"description":"Filing reference number, e.g. FRA-2025-E-00042.","schema":{"type":"string"}}],"responses":{"200":{"description":"The filing's figures.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilingFigures"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/filings/{reference}/status":{"get":{"operationId":"getFilingStatus","tags":["Filings"],"summary":"Filing status (poll this)","description":"Workflow status, validation result, reviewer assignment and AI pre-review summary. Poll with back-off (e.g. 5 s → 60 s); webhooks (`filing.status_changed`) avoid polling. For a sandbox filing `status` is the simulated status.","x-rate-limit":"60/min","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"reference","in":"path","required":true,"description":"Filing reference number, e.g. FRA-2025-E-00042.","schema":{"type":"string"}}],"responses":{"200":{"description":"Status.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilingStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/filings/{reference}/xbrl":{"get":{"operationId":"downloadFilingXbrl","tags":["Filings"],"summary":"Download the XBRL instance of an accepted filing","description":"Only for accepted filings of the authenticated company.","x-rate-limit":"30/min","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"reference","in":"path","required":true,"description":"Filing reference number, e.g. FRA-2025-E-00042.","schema":{"type":"string"}}],"responses":{"200":{"description":"XBRL 2.1 instance.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/xml":{"schema":{"type":"string","description":"XBRL instance document."}}}},"422":{"description":"The filing is not accepted yet.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"status":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/health":{"get":{"operationId":"health","tags":["Health"],"summary":"API health","description":"Database reachability only; no internal state.","x-rate-limit":"60/min","security":[],"responses":{"200":{"description":"Healthy.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"Degraded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/health/detailed":{"get":{"operationId":"healthDetailed","tags":["Health"],"summary":"Component health (database, cache, queue, storage)","description":"For load balancers and monitoring; not throttled.","security":[],"responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","description":"Probe result.","additionalProperties":true}}}},"503":{"description":"Not healthy / not ready."}}}},"/health/live":{"get":{"operationId":"healthLive","tags":["Health"],"summary":"Liveness probe","description":"For load balancers and monitoring; not throttled.","security":[],"responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","description":"Probe result.","additionalProperties":true}}}},"503":{"description":"Not healthy / not ready."}}}},"/health/metrics":{"get":{"operationId":"healthMetrics","tags":["Health"],"summary":"Operational metrics","description":"FRA administrators only (portal session).","security":[{"portalSession":[]}],"responses":{"200":{"description":"Metrics.","content":{"application/json":{"schema":{"type":"object","description":"Metrics.","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/health/ready":{"get":{"operationId":"healthReady","tags":["Health"],"summary":"Readiness probe","description":"For load balancers and monitoring; not throttled.","security":[],"responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","description":"Probe result.","additionalProperties":true}}}},"503":{"description":"Not healthy / not ready."}}}},"/internal/documents/{id}/extract":{"post":{"operationId":"internalDocumentExtract","tags":["Portal extraction"],"summary":"Queue extraction of a regulatory document (internal)","description":"Internal FRA pipeline; Sanctum personal access token.","security":[{"sanctumToken":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"id","in":"path","required":true,"description":"FRA document id.","schema":{"type":"integer"}}],"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"type":"object","description":"Result.","additionalProperties":true}}},"headers":{"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"x-idempotent":true}},"/oauth/token":{"post":{"operationId":"issueToken","tags":["Authentication"],"summary":"Obtain an access token","description":"OAuth 2.0 client-credentials grant. Send `client_id` and `client_secret` (JSON or form). `scope` (space-separated) narrows the token to a subset of the client's scopes; unknown scopes are dropped. Excluded from Idempotency-Key handling: its response is a credential and is never stored.","x-rate-limit":"10/min per IP","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"responses":{"200":{"description":"Token issued.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"},"example":{"access_token":"3kT…","token_type":"Bearer","expires_in":3600,"scope":"filing:submit filing:status"}}}},"401":{"description":"Unknown, inactive or expired client, or wrong secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/openapi.json":{"get":{"operationId":"openapiJson","tags":["Developer"],"summary":"This document (JSON)","description":"","x-rate-limit":"60/min","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","description":"OpenAPI document.","additionalProperties":true}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/openapi.yaml":{"get":{"operationId":"openapiYaml","tags":["Developer"],"summary":"This document (YAML)","description":"","x-rate-limit":"60/min","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/yaml":{"schema":{"type":"string"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-key":{"get":{"operationId":"getPublicKey","tags":["Keys"],"summary":"Current FRA transport public key","description":"RSA-2048 public key (PEM) to wrap the AES key of every encrypted payload. Cache it by `version`; send that version as `fra_key_version`. When called with a valid Bearer token the client's cached key version is recorded (best effort).","x-rate-limit":"60/min","security":[],"responses":{"200":{"description":"The active key.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKey"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public-key/{version}":{"get":{"operationId":"getPublicKeyVersion","tags":["Keys"],"summary":"A specific FRA public key version","description":"For payloads prepared just before a rotation.","x-rate-limit":"60/min","security":[],"parameters":[{"name":"version","in":"path","required":true,"description":"Key version.","schema":{"type":"integer"}}],"responses":{"200":{"description":"The key.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKey"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public/filings/{submission}/validation":{"get":{"operationId":"getPublicFilingValidation","tags":["Public data"],"summary":"Validation results of a published filing","description":"The STORED validation outcome of the published XBRL report of an accepted filing (in the spirit of filings.xbrl.org): overall status (valid / warnings / errors), counts per layer and every finding with rule id, severity, Arabic/English message, concept and context. Platform native checks, Arelle on the published packages and the FRA business rules. Never re-validated on request; nothing internal (reviewer notes, the uploaded file, users) is included. 404 for anything that is not an accepted public filing.","x-rate-limit":"60/min","security":[],"parameters":[{"name":"submission","in":"path","required":true,"description":"Filing id (as in GET /xbrl/filings).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Validation results.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicFilingValidation"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public/search":{"get":{"operationId":"searchPublicFilings","tags":["Public data"],"summary":"Full-text search over accepted filings","description":"Searches the public text of every filing the FRA accepted — company names (Arabic/English), filing metadata (reference, template, period, sector), figure labels and concepts of the published XBRL report, note and accounting-policy text blocks. Never drafts, filings under review, rejected filings or sandbox data.\n\nArabic is normalised on both sides: diacritics and tatweel are ignored, alef forms (أ إ آ) read as ا, ى as ي, ة as ه, and Arabic-Indic digits as 0-9 — «الشركه» finds «الشركة». Put a phrase in double quotes for an exact phrase; all words must match. Results are ordered by relevance and carry an HTML snippet (`snippet_html`: escaped text, matches in `<mark>`). Give `q` or at least one filter. Cached for a short time (`Cache-Control: public`).","x-rate-limit":"60/min","security":[],"parameters":[{"name":"q","in":"query","description":"Words and \"quoted phrases\".","schema":{"type":"string","maxLength":200}},{"name":"company","in":"query","description":"FRA licence number(s) or LEI(s), comma separated, or part of the company name.","schema":{"type":"string"}},{"name":"sector","in":"query","description":"Sector code(s).","schema":{"type":"string"}},{"name":"template","in":"query","description":"Template code(s).","schema":{"type":"string"}},{"name":"fiscal_year","in":"query","description":"Fiscal year(s).","schema":{"type":"string","pattern":"^\\d{4}(,\\d{4})*$"}},{"name":"period","in":"query","description":"Annual (FY) or quarter.","schema":{"type":"string","enum":["FY","Q1","Q2","Q3","Q4"]}},{"name":"accepted_from","in":"query","description":"Accepted on or after.","schema":{"type":"string","format":"date"}},{"name":"accepted_to","in":"query","description":"Accepted on or before.","schema":{"type":"string","format":"date"}},{"name":"kind","in":"query","description":"Only filings, notes/policies or statement figures.","schema":{"type":"string","enum":["filing","note","figure"]}},{"name":"locale","in":"query","description":"Language of the text (bilingual rows always match).","schema":{"type":"string","enum":["ar","en"]}},{"name":"page","in":"query","description":"Page.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"A page of results.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSearchPage"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/public/xbrl/check":{"post":{"operationId":"checkXbrlPublic","tags":["Public data"],"summary":"Free XBRL check (anonymous)","description":"Anyone can validate an Inline XBRL / XBRL 2.1 / xBRL-JSON report or a report package against the FRA rules — the same engine as POST /xbrl/test-filing and the filing intake (rule ids, layers, Arabic/English messages) — WITHOUT filing anything and WITHOUT the file being kept: it is malware-scanned, validated in memory and deleted; only an anonymous counter (hash prefix, size, outcome, keyed IP hash) is recorded. The entity identifier is NOT checked against a registered company (anonymous); `validation.service.notes` says so. Arelle runs only when the FRA enables it for this service.\n\nSend `multipart/form-data` (`file`) or JSON (`file_name` + `content_base64`). Strict per-IP limits (per minute and per day) and a size cap (default 20 MB, 413 above it). No credentials needed. An Idempotency-Key is optional; with one, the response is kept 24 h for replay like every /api/v1 POST.","x-rate-limit":"5/min, 50/day","security":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"The report or report package.","contentMediaType":"application/octet-stream"}},"required":["file"]}},"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","maxLength":200},"content_base64":{"type":"string","contentEncoding":"base64"}},"required":["file_name","content_base64"]}}}},"responses":{"200":{"description":"The validation report.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicXbrlCheckResult"}}}},"413":{"description":"The file is larger than the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Missing, empty or unsupported upload, invalid base64, or refused by the malware scan.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ApiError"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"x-idempotent":true}},"/reporting-periods":{"get":{"operationId":"listReportingPeriods","tags":["Reference data"],"summary":"Official FRA reporting calendar","description":"Published reporting periods of a year (default: current year).","x-rate-limit":"60/min","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"year","in":"query","description":"Fiscal year.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Periods.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportingPeriodList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/rules":{"get":{"operationId":"listRules","tags":["Rules"],"summary":"Canonical rules registry","description":"Paginated; `since` returns rules changed after a timestamp (delta sync).","x-rate-limit":"120/min (shared api limiter)","security":[],"parameters":[{"name":"since","in":"query","description":"Only rules updated since.","schema":{"type":"string","format":"date-time"}},{"name":"category","in":"query","description":"Rule category.","schema":{"type":"string"}},{"name":"severity","in":"query","description":"critical | warning | info.","schema":{"type":"string"}},{"name":"per_page","in":"query","description":"Page size.","schema":{"type":"integer","maximum":500,"default":100}},{"name":"page","in":"query","description":"Page.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Rules.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CanonicalRule"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/rules/evaluate":{"post":{"operationId":"evaluateRules","tags":["Rules"],"summary":"Evaluate rules against an envelope (stateless)","description":"Runs the FRA rules (or the given subset) against a disclosure envelope and returns the flags it would raise. Stores nothing.","x-rate-limit":"120/min (shared api limiter)","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"envelope":{"$ref":"#/components/schemas/DisclosureEnvelope"},"rules":{"type":"array","items":{"type":"string"},"description":"Rule ids to evaluate (default: all applicable)."}},"required":["envelope"]}}}},"responses":{"200":{"description":"Flags.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RuleFlag"}},"meta":{"type":"object","properties":{"count":{"type":"integer"},"evaluated_at":{"type":"string","format":"date-time"}}}}}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"x-idempotent":true}},"/rules/{ruleId}":{"get":{"operationId":"getRule","tags":["Rules"],"summary":"One rule","description":"","x-rate-limit":"120/min (shared api limiter)","security":[],"parameters":[{"name":"ruleId","in":"path","required":true,"description":"Rule id.","schema":{"type":"string","pattern":"^[A-Z0-9_]+$"}}],"responses":{"200":{"description":"Rule.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CanonicalRule"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/statistics/by-sector":{"get":{"operationId":"statisticsBySector","tags":["Public statistics"],"summary":"Statistics by sector","description":"Companies, filings and acceptance rate per sector (this year). Cached for one hour. Sandbox and test data are never counted.","x-rate-limit":"60/min","security":[],"parameters":[],"responses":{"200":{"description":"Statistics.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatsSector"}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/statistics/monthly-trend":{"get":{"operationId":"statisticsMonthlyTrend","tags":["Public statistics"],"summary":"Monthly filing trend","description":"Filings and acceptances per month. Cached for one hour. Sandbox and test data are never counted.","x-rate-limit":"60/min","security":[],"parameters":[{"name":"months","in":"query","description":"Number of months.","schema":{"type":"integer","minimum":1,"maximum":24,"default":12}}],"responses":{"200":{"description":"Statistics.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatsMonth"}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/statistics/overview":{"get":{"operationId":"statisticsOverview","tags":["Public statistics"],"summary":"Platform overview","description":"Companies, filings this year, acceptance rate. Cached for one hour. Sandbox and test data are never counted.","x-rate-limit":"60/min","security":[],"parameters":[],"responses":{"200":{"description":"Statistics.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsOverview"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/statistics/top-companies":{"get":{"operationId":"statisticsTopCompanies","tags":["Public statistics"],"summary":"Top companies by compliance score","description":"Public compliance ranking. Cached for one hour. Sandbox and test data are never counted.","x-rate-limit":"60/min","security":[],"parameters":[],"responses":{"200":{"description":"Statistics.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatsCompany"}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/statistics/upcoming-deadlines":{"get":{"operationId":"statisticsUpcomingDeadlines","tags":["Public statistics"],"summary":"Upcoming filing deadlines","description":"Template deadlines in the coming weeks with filing counts so far. Cached for one hour. Sandbox and test data are never counted.","x-rate-limit":"60/min","security":[],"parameters":[],"responses":{"200":{"description":"Statistics.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"Deadline aggregate.","additionalProperties":true}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/taxonomies":{"get":{"operationId":"listTaxonomies","tags":["Taxonomies"],"summary":"Active XBRL taxonomies","description":"","x-rate-limit":"60/min","security":[{"fraOAuth":["taxonomy:read"],"mutualTLS":[]}],"responses":{"200":{"description":"Taxonomies.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Taxonomy"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/taxonomies/for-sector/{sectorCode}":{"get":{"operationId":"getTaxonomiesForSector","tags":["Taxonomies"],"summary":"Taxonomies applicable to a sector","description":"","x-rate-limit":"60/min","security":[{"fraOAuth":["taxonomy:read"],"mutualTLS":[]}],"parameters":[{"name":"sectorCode","in":"path","required":true,"description":"Sector code, e.g. INS, LEAS.","schema":{"type":"string"}}],"responses":{"200":{"description":"Taxonomies.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Taxonomy"}},"sector_code":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/taxonomies/{taxonomy}":{"get":{"operationId":"getTaxonomy","tags":["Taxonomies"],"summary":"A taxonomy with its concepts","description":"","x-rate-limit":"60/min","security":[{"fraOAuth":["taxonomy:read"],"mutualTLS":[]}],"parameters":[{"name":"taxonomy","in":"path","required":true,"description":"Taxonomy id.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Taxonomy.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Taxonomy"},{"type":"object","properties":{"concepts":{"type":"array","items":{"$ref":"#/components/schemas/TaxonomyConcept"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates":{"get":{"operationId":"listTemplates","tags":["Templates"],"summary":"Active disclosure templates","description":"Without fields; use /templates/{template} or /templates/sync for fields.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"sector_code","in":"query","description":"Templates applicable to this sector.","schema":{"type":"string"}},{"name":"frequency","in":"query","description":"Filing frequency, e.g. annual, quarterly.","schema":{"type":"string"}}],"responses":{"200":{"description":"Templates.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"total":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/label-maps":{"get":{"operationId":"getLabelMaps","tags":["Templates"],"summary":"Label → field mapping dictionary","description":"The label aliases the platform uses to map extracted line items to fields.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"responses":{"200":{"description":"Label map.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Label → field key.","additionalProperties":true},"total":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/sector/{sectorCode}":{"get":{"operationId":"getTemplateForSector","tags":["Templates"],"summary":"The template of a sector","description":"The sector-specific template, falling back to the general one.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"sectorCode","in":"path","required":true,"description":"Sector code, e.g. INS, LEAS.","schema":{"type":"string"}}],"responses":{"200":{"description":"Template with fields.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/sync":{"get":{"operationId":"syncTemplates","tags":["Templates"],"summary":"Published templates with their fields (delta sync)","description":"For IR systems that mirror the templates. `since` returns only templates updated after that time.","x-rate-limit":"30/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"since","in":"query","description":"Only templates updated since.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Templates with fields.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateSync"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/{template}":{"get":{"operationId":"getTemplate","tags":["Templates"],"summary":"A template with its fields","description":"404 when inactive.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"template","in":"path","required":true,"description":"Template id (from GET /templates).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Template.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/{template}/encrypted":{"get":{"operationId":"getTemplateEncrypted","tags":["Templates"],"summary":"The template, encrypted to the client","description":"The template JSON in the hybrid envelope, encrypted under the CLIENT's RSA public key and signed by the FRA — decrypt with your private key, verify with the FRA public key.","x-rate-limit":"30/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"template","in":"path","required":true,"description":"Template id (from GET /templates).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Encrypted template.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EncryptedEnvelope"},{"type":"object","properties":{"checksum_sha256":{"type":"string","description":"SHA-256 of the plaintext JSON."},"fra_key_version":{"type":"integer"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/{template}/field-hints":{"get":{"operationId":"getTemplateFieldHints","tags":["Templates"],"summary":"Field hints for automatic mapping","description":"Per field: labels, type, section, label aliases, XBRL concept, required.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"template","in":"path","required":true,"description":"Template id (from GET /templates).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Hints keyed by field_key.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"field_key → hint.","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/{template}/fields":{"get":{"operationId":"getTemplateFields","tags":["Templates"],"summary":"The template's fields","description":"Ordered as on the form.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"template","in":"path","required":true,"description":"Template id (from GET /templates).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Fields.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateField"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/{template}/schema":{"get":{"operationId":"getTemplateSchema","tags":["Templates"],"summary":"The template's form schema","description":"The JSON form schema used by the portal wizard.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"template","in":"path","required":true,"description":"Template id (from GET /templates).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Form schema.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Form schema.","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/templates/{template}/validators":{"get":{"operationId":"getTemplateValidators","tags":["Templates"],"summary":"Validation rules of a template","description":"Cross-check formulas applied by the FRA, with tolerance and severity.","x-rate-limit":"60/min","security":[{"fraOAuth":["template:read"],"mutualTLS":[]}],"parameters":[{"name":"template","in":"path","required":true,"description":"Template id (from GET /templates).","schema":{"type":"integer"}}],"responses":{"200":{"description":"Validators.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateValidators"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/xbrl/concepts":{"get":{"operationId":"listConcepts","tags":["Public data"],"summary":"Concepts used in filings","description":"Concepts with labels, data type and period type; search by `q`, restrict by namespace prefix.","x-rate-limit":"60/min","security":[],"parameters":[{"name":"namespace","in":"query","description":"Namespace prefix, e.g. ifrs-full.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Search text.","schema":{"type":"string"}}],"responses":{"200":{"description":"Concepts.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","description":"Concept list (data[] of concept_qname, label_ar, label_en, data_type, period_type).","additionalProperties":true}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/xbrl/sector-benchmarks":{"get":{"operationId":"getSectorBenchmarks","tags":["Public data"],"summary":"Sector benchmarks","description":"Average and median of each concept across the sector's latest accepted filings.","x-rate-limit":"60/min","security":[],"parameters":[{"name":"sector_id","in":"query","required":true,"description":"Sector id.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Benchmarks.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","description":"Sector + benchmarks[] (concept_qname, label_ar, avg_value, median_value, count).","additionalProperties":true}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/xbrl/test-filing":{"post":{"operationId":"xbrlTestFiling","tags":["XBRL test filing"],"summary":"Validate an XBRL report without filing it (test filing)","description":"Runs the full Channel D validation of an XBRL report — exactly what POST /filings/submit would apply — and returns the machine-readable validation report (`XbrlValidationReport`): every finding with its numbered rule id (rules file: `GET /xbrl/filer-manual/rules.json`), its layer (package, xbrl, calculation, duplicates, filing, data_quality, business), severity and Arabic/English message. **Nothing is filed** and no filing is created; the run is kept for audit.\n\nSend the report as `multipart/form-data` (`file`) or as JSON (`file_name` + `content_base64`). Report packages (`.xbri`, `.xbr`, `.zip`) are accepted, including multi-document Inline XBRL document sets. `template_code` is only needed when the report does not reference an FRA template entry point; `fiscal_year` checks rule FRA-109.\n\nWorks with sandbox and production credentials (the company of the credential is the one whose identifier is checked). The file is malware-scanned first. HTTP 200 whenever the report could be validated — `validation.valid` says whether it would be accepted.","x-rate-limit":"20/min","security":[{"fraOAuth":["filing:submit"],"mutualTLS":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"The report or report package.","contentMediaType":"application/octet-stream"},"template_code":{"type":"string"},"fiscal_year":{"type":"integer"}},"required":["file"]}},"application/json":{"schema":{"$ref":"#/components/schemas/XbrlTestFilingRequest"}}}},"responses":{"200":{"description":"The validation report (valid or not).","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XbrlTestFilingResult"}}}},"422":{"description":"Missing or unreadable upload, unknown template_code, or the file failed the malware scan.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ApiError"},{"$ref":"#/components/schemas/ValidationError"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-idempotent":true}},"/agent/companies":{"get":{"operationId":"listAgentCompanies","tags":["Filing agents"],"summary":"Companies that authorised this filing agent","description":"Only authorisations in force today (active, inside valid_from…valid_to, agent approved by the FRA). Never lists any other company. Agent clients only.","security":[{"fraOAuth":["filing:status"],"mutualTLS":[]}],"parameters":[{"name":"X-FRA-Agent-User-Token","in":"header","required":true,"description":"Personal API token of the agent staff member (issued in the agent workspace; expires).","schema":{"type":"string"}}],"responses":{"200":{"description":"The authorising companies.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"filing_agent":{"type":"object","properties":{"id":{"type":"integer"},"legal_name_ar":{"type":"string"},"licence_number":{"type":"string"}}},"data":{"type":"array","items":{"type":"object","properties":{"company_id":{"type":"string"},"fra_license_number":{"type":["string","null"]},"name_ar":{"type":["string","null"]},"name":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string","enum":["prepare","submit","respond_observations","view"]}},"template_ids":{"type":["array","null"],"items":{"type":"integer"}},"fiscal_years":{"type":["array","null"],"items":{"type":"integer"}},"valid_from":{"type":["string","null"],"format":"date"},"valid_to":{"type":["string","null"],"format":"date"}}}}}}}}},"401":{"description":"Missing / invalid bearer token, or missing / expired agent user token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Not an agent client (`not_an_agent_client`), agent not active, or scope missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/agent/client/rotate-secret":{"post":{"operationId":"rotateAgentClientSecret","tags":["Filing agents"],"summary":"Rotate the agent client secret","description":"Issues a new client secret with a new expiry (agents.api.client_secret_ttl_days) and revokes every access token issued under the previous one. Requires the personal token of an agent admin. Audited. The response carries a credential and is never stored by the idempotency layer: a retry with the same key rotates again.","security":[{"fraOAuth":[],"mutualTLS":[]}],"x-rate-limit":"5/min","x-idempotent":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyRequired"},{"name":"X-FRA-Agent-User-Token","in":"header","required":true,"description":"Personal API token of the agent staff member (issued in the agent workspace; expires).","schema":{"type":"string"}}],"responses":{"200":{"description":"New secret (shown once).","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"message":{"type":"string"}},"required":["client_id","client_secret","expires_at"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Missing / invalid bearer token or agent user token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Not an agent client, or the user token is not an agent admin's (`agent_admin_required`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/mcp":{"post":{"operationId":"mcpRequest","tags":["MCP"],"summary":"MCP JSON-RPC message (initialize, ping, tools/list, tools/call, resources/list, resources/read)","description":"One JSON-RPC 2.0 message per request (no batches). `initialize` returns the negotiated `protocolVersion` (2025-06-18, 2025-03-26 or 2024-11-05), the server capabilities and an `Mcp-Session-Id` header; send it back on later requests (an unknown session → 404 / -32004). A notification (no `id`) is accepted with 202 and no body. Responses are `application/json` (no SSE stream; GET on this URL → 405). Tool results carry `content` (text) and `structuredContent`; a tool that cannot answer (e.g. filing not found) returns `isError: true`. Every call is audited. Limits: per caller 60 messages and 30 tool calls per minute (429 / -32003), plus the API client quota.","security":[{"fraOAuth":["mcp:read"],"mutualTLS":[]},{"fraPersonalToken":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"Mcp-Session-Id","in":"header","required":false,"description":"Session id returned by initialize.","schema":{"type":"string","maxLength":100}},{"name":"MCP-Protocol-Version","in":"header","required":false,"description":"Negotiated protocol version (an unsupported value → 400 / -32005).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer"]},"method":{"type":"string","enum":["initialize","ping","tools/list","tools/call","resources/list","resources/read","notifications/initialized","notifications/cancelled"]},"params":{"type":"object","additionalProperties":true}}},"example":{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_filing_facts","arguments":{"filing":"FRA-2025-E-00042","concept":"ifrs-full:Revenue"}}}}}},"responses":{"200":{"description":"JSON-RPC response (result or error).","headers":{"Mcp-Session-Id":{"description":"On initialize: the session id.","schema":{"type":"string"}},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Idempotency-Replayed":{"$ref":"#/components/headers/Idempotency-Replayed"}},"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["jsonrpc","id","result"],"properties":{"jsonrpc":{"type":"string"},"id":{"type":["string","integer"]},"result":{"type":"object","additionalProperties":true}}},{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}]}}}},"202":{"description":"Notification accepted (no body)."},"400":{"description":"Parse error, invalid request, batch, unsupported protocol version, or a bad Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}},"401":{"description":"Missing, invalid or expired token (-32001).","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}},"403":{"description":"Missing scope mcp:read, not FRA staff, IP / client certificate refused (-32002).","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}},"404":{"description":"Session not found or expired (-32004), or the server is disabled.","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}},"409":{"$ref":"#/components/responses/Conflict"},"413":{"description":"Request body too large.","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}},"429":{"description":"Rate limit or API client quota exceeded (-32003); Retry-After.","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer","null"]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"-32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, -32001 unauthorised, -32002 forbidden, -32003 rate limited, -32004 session not found, -32005 unsupported protocol version"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}}}}},"x-rate-limit":"60/min per caller","x-idempotent":true}}},"webhooks":{"filing.status_changed":{"post":{"operationId":"webhook_filing_status_changed","summary":"filing.status_changed","description":"A filing changed status (submitted, assigned, under review, accepted, rejected, amendment requested). Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"filing.inspector_assigned":{"post":{"operationId":"webhook_filing_inspector_assigned","summary":"filing.inspector_assigned","description":"A reviewer was assigned to a filing. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"filing.amendment_requested":{"post":{"operationId":"webhook_filing_amendment_requested","summary":"filing.amendment_requested","description":"The FRA requested an amendment. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"filing.validation_completed":{"post":{"operationId":"webhook_filing_validation_completed","summary":"filing.validation_completed","description":"XBRL validation finished. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"template.updated":{"post":{"operationId":"webhook_template_updated","summary":"template.updated","description":"A template the client uses changed. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"template.deployed":{"post":{"operationId":"webhook_template_deployed","summary":"template.deployed","description":"A template was deployed to the client. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"access_request.approved":{"post":{"operationId":"webhook_access_request_approved","summary":"access_request.approved","description":"An access request was approved. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}},"access_request.rejected":{"post":{"operationId":"webhook_access_request_rejected","summary":"access_request.rejected","description":"An access request was rejected. Delivered to the client's webhook_url; retried with back-off on non-2xx.","parameters":[{"name":"X-FRA-Event","in":"header","required":true,"description":"Event name.","schema":{"type":"string"}},{"name":"X-FRA-Timestamp","in":"header","required":true,"description":"Send time; reject if more than ±5 minutes from your clock.","schema":{"type":"string","format":"date-time"}},{"name":"X-FRA-Signature","in":"header","required":true,"description":"`sha256=` + hex HMAC-SHA256 of `{X-FRA-Timestamp}.{raw body}` with the client's webhook secret. Compare in constant time.","schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"name":"X-FRA-Signature-Version","in":"header","required":true,"description":"Signature scheme version.","schema":{"type":"string","enum":["2"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"2XX":{"description":"Acknowledged."}}}}},"components":{"securitySchemes":{"fraOAuth":{"type":"oauth2","description":"OAuth 2.0 client credentials. Send the token as `Authorization: Bearer <access_token>`. Tokens are opaque, last 3600 s, and are bound to the client (and its IP allow-list, when set).","flows":{"clientCredentials":{"tokenUrl":"https://fra2.corprise.ai/api/v1/oauth/token","scopes":{"filing:submit":"Submit filings, structured figures and attachments.","filing:status":"Read filings, their status, deadlines and the reporting calendar.","template:read":"Read templates, fields and validators.","taxonomy:read":"Read taxonomies.","client:key_rotate":"Replace the client's RSA signing key.","compliance:read_all":"Read any company's compliance history (FRA/partner clients only).","mcp:read":"Read public data through the MCP server (POST /mcp)."}}}},"agencyApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"The secret of an agency API client with an active data-sharing agreement (also accepted as a Bearer token)."},"portalSession":{"type":"apiKey","in":"cookie","name":"fra2_session","description":"Logged-in portal session (company users) — the portal's own pages call these; mutating calls also need the X-CSRF-TOKEN header."},"mutualTLS":{"type":"mutualTLS","description":"TLS client certificate registered with the FRA for the API client (PEM, pinned by SHA-256 fingerprint). Required in production for every Bearer-authenticated call; sandbox credentials are exempt."},"sanctumToken":{"type":"http","scheme":"bearer","description":"Laravel Sanctum personal access token (internal FRA services)."},"fraPersonalToken":{"type":"http","scheme":"bearer","description":"FRA staff personal token for the MCP server (issued on /fra/mcp/tokens, ability mcp:read, expires)."}},"parameters":{"IdempotencyKeyRequired":{"name":"Idempotency-Key","in":"header","required":true,"description":"Required. A unique key per operation (a UUID). Missing → 400 `idempotency_key_required`. Within 24 h the same key with the same body replays the stored response (`Idempotency-Replayed: true`); with a different body → 422 `idempotency_key_reused`; while the first is in flight → 409 `idempotency_request_in_progress`. Scoped per API client. 5xx, 401, 403 and 429 outcomes are not stored.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","description":"Optional. A unique key per operation (a UUID). Within 24 h the same key with the same body replays the stored response (`Idempotency-Replayed: true`); with a different body → 422 `idempotency_key_reused`; while the first is in flight → 409 `idempotency_request_in_progress`. Scoped per API client (session user / IP for public endpoints). 5xx, 401, 403 and 429 outcomes are not stored.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}},"headers":{"X-RateLimit-Limit":{"description":"Requests allowed in the current window (per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds until the window resets (on 429).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time the per-minute window resets.","schema":{"type":"integer"}},"X-RateLimit-Day-Limit":{"description":"The API client's daily quota.","schema":{"type":"integer"}},"X-RateLimit-Day-Remaining":{"description":"Requests left in the daily quota.","schema":{"type":"integer"}},"Idempotency-Replayed":{"description":"`true` when the response is the stored outcome of an earlier request with the same Idempotency-Key.","schema":{"type":"string","enum":["true"]}},"ETag":{"description":"Entity tag of the response body.","schema":{"type":"string"}},"Cache-Control":{"description":"Public caching policy.","schema":{"type":"string"}},"X-FRA-Environment":{"description":"`sandbox` or `production` — which environment the credential operates on.","schema":{"type":"string","enum":["sandbox","production"]}}},"responses":{"BadRequest":{"description":"Malformed request: missing (`idempotency_key_required`) or invalid (`invalid_idempotency_key`) Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Unauthorized":{"description":"Missing, invalid or expired token (`missing_token`, `invalid_token`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Forbidden":{"description":"Missing scope (`insufficient_scope`), IP not allowed (`ip_not_allowed`), client certificate missing or not accepted (`client_certificate_required`, `client_certificate_mismatch`, `client_certificate_expired`, `client_certificate_revoked`, `client_certificate_not_registered`, `client_certificate_invalid`), client not bound to a company, or sandbox restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"NotFound":{"description":"Not found (or not yours).","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"Conflict":{"description":"Conflict: duplicate payload (`duplicate_submission`), idempotent request in progress (`idempotency_request_in_progress`), or a lost status race.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ValidationFailed":{"description":"Validation failed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"TooManyRequests":{"description":"Rate limit exceeded — for authenticated calls the API client's own per-minute or per-day quota (`rate_limit_exceeded`, `retry_after` seconds).","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"ServerError":{"description":"Processing error (`processing_error`); the message is sanitised.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"schemas":{"ApiError":{"type":"object","properties":{"error":{"type":"string","description":"Machine-readable error code, e.g. unknown_template, decryption_failed, checksum_mismatch, key_version_mismatch, submission_not_ready, invalid_figures, duplicate_submission, idempotency_key_reused, insufficient_scope, sandbox_unsupported."},"message":{"type":"string","description":"Human-readable explanation."},"code":{"type":"string","description":"Sub-code, e.g. signature_invalid / decryption_error, missing_token, invalid_token."}},"required":["error"],"description":"Error model of the platform's own errors."},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Field → messages."}},"required":["message","errors"],"description":"Request validation failure (HTTP 422)."},"OAuthError":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_client"]},"error_description":{"type":"string"}},"required":["error"]},"TokenRequest":{"type":"object","properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string","description":"Space-separated subset of the client's scopes (optional)."}},"required":["grant_type","client_id","client_secret"]},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string","description":"Opaque token (80 characters)."},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer","description":"Seconds (3600)."},"scope":{"type":"string","description":"Granted scopes, space-separated."}},"required":["access_token","token_type","expires_in","scope"]},"PublicKey":{"type":"object","properties":{"public_key":{"type":"string","description":"PEM, RSA-2048."},"version":{"type":"integer","description":"Send as fra_key_version."},"algorithm":{"type":"string","enum":["RSA-2048"]},"purpose":{"type":"string","enum":["xbrl_transport"]},"expires_at":{"type":["string","null"],"format":"date-time"},"fingerprint":{"type":"string","description":"SHA256:<base64> of the DER key."},"is_active":{"type":"boolean"}},"required":["public_key","version"]},"EncryptedEnvelope":{"type":"object","properties":{"encrypted_key":{"type":"string","description":"The 32-byte AES-256 key, encrypted with RSA-OAEP (SHA-1, MGF1-SHA-1 — OpenSSL OPENSSL_PKCS1_OAEP_PADDING) under the RECIPIENT's public key (FRA's for requests).","contentEncoding":"base64"},"iv":{"type":"string","description":"12-byte random GCM nonce.","contentEncoding":"base64"},"ciphertext":{"type":"string","description":"AES-256-GCM ciphertext of the plaintext (no AAD).","contentEncoding":"base64"},"auth_tag":{"type":"string","description":"16-byte GCM authentication tag.","contentEncoding":"base64"},"signature":{"type":"string","description":"RSASSA-PKCS1-v1_5 / SHA-256 signature by the SENDER over the raw ciphertext bytes (not the base64 text).","contentEncoding":"base64"}},"required":["encrypted_key","iv","ciphertext","auth_tag","signature"],"description":"Hybrid encryption envelope (XBRLEncryptionService). Steps for a request: (1) random AES-256 key + 12-byte IV; (2) AES-256-GCM encrypt the plaintext → ciphertext + 16-byte tag; (3) RSA-OAEP-encrypt the AES key with the FRA public key; (4) sign the ciphertext bytes with your RSA private key (PKCS#1 v1.5, SHA-256); (5) base64 every field. The FRA verifies the signature first, then decrypts, then compares SHA-256(plaintext) with the checksum you send."},"XbrlFilingRequest":{"allOf":[{"$ref":"#/components/schemas/EncryptedEnvelope"},{"type":"object","properties":{"fra_key_version":{"type":"integer","description":"Version of the FRA public key used."},"metadata":{"type":"object","properties":{"template_code":{"type":"string","description":"Template code from GET /templates."},"period_start":{"type":"string","format":"date"},"period_end":{"type":"string","format":"date"},"fiscal_year":{"type":"integer"},"checksum_sha256":{"type":"string","description":"Hex SHA-256 of the plaintext document."},"content_type":{"type":"string","description":"Format of the plaintext; a ZIP plaintext is always read as a report package.","enum":["xbrl","ixbrl","iXBRL","XBRL","IXBRL","xbri","xbr","zip","xbrl-json","json","xbrl-csv"]},"file_name":{"type":"string","description":"File name of the report or package, e.g. FRA-LIC-0001-2025-12-31-annual.xbri (naming rule FRA-121).","maxLength":200},"sandbox_outcome":{"type":"string","description":"Sandbox only: simulated decision.","enum":["accepted","rejected","requires_amendment"]}},"required":["template_code","period_start","period_end","fiscal_year","checksum_sha256"]},"attachments":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/EncryptedEnvelope"},{"type":"object","properties":{"filename":{"type":"string"}}}]},"description":"Optional encrypted files (same envelope, same FRA key version)."}},"required":["fra_key_version","metadata"]}]},"StructuredFilingRequest":{"allOf":[{"$ref":"#/components/schemas/EncryptedEnvelope"},{"type":"object","properties":{"fra_key_version":{"type":"integer"},"metadata":{"type":"object","properties":{"template_code":{"type":"string"},"fiscal_year":{"type":"integer","minimum":1990,"maximum":2100},"period_start":{"type":["string","null"],"format":"date"},"period_end":{"type":["string","null"],"format":"date"},"quarter":{"type":["integer","null"],"minimum":1,"maximum":4},"period_label":{"type":["string","null"],"maxLength":64},"checksum_sha256":{"type":"string","description":"Hex SHA-256 of the plaintext JSON bytes.","minLength":64,"maxLength":64},"submit":{"type":["boolean","null"],"description":"Submit to the FRA when every readiness gate passes."},"sandbox_outcome":{"type":"string","description":"Sandbox only: simulated decision.","enum":["accepted","rejected","requires_amendment"]}},"required":["template_code","fiscal_year","checksum_sha256"]}},"required":["fra_key_version","metadata"]}]},"StructuredFilingPayload":{"type":"object","properties":{"format":{"type":"string","const":"fra-structured-json-v1"},"figures":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Template field key (preferred)."},"concept":{"type":"string","description":"XBRL concept QName carried by exactly one field (alternative to field_key)."},"current":{"type":["number","string","null"],"description":"Current-period value; strings like \"1,250\" or \"(5)\" are read as numbers."},"prior":{"type":["number","string","null"],"description":"Comparative value."},"note":{"type":"string","description":"Note reference (≤ 20 chars)."}}}},"text":{"type":"object","additionalProperties":{"type":"string"},"description":"Text fields by field_key (≤ 5000 chars each)."}},"required":["format","figures"],"description":"The PLAINTEXT of a Channel B filing, before encryption. Its exact bytes are what checksum_sha256 covers."},"FilingReceived":{"type":"object","properties":{"filing_reference":{"type":"string"},"submission_id":{"type":"integer"},"status":{"type":"string","enum":["received"]},"decryption_status":{"type":"string"},"signature_valid":{"type":"boolean"},"validation_status":{"type":"string"},"estimated_review_time":{"type":"string"},"rejected_attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}}},"timestamp":{"type":"string","format":"date-time"},"sandbox":{"type":"boolean"},"simulated_status":{"type":"string"},"simulated_gates":{"type":"array","items":{"type":"string"}},"xbrl_mode":{"type":"string","description":"How the report was read.","enum":["standard","legacy_dynamic_fields"]},"xbrl_validation":{"type":"object","properties":{"run_id":{"type":"integer"},"status":{"type":"string","enum":["passed","warnings"]},"rules_version":{"type":"string"},"errors":{"type":"integer"},"warnings":{"type":"integer"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/XbrlValidationFinding"}}},"description":"Standard mode: the stored validation run of the report (warnings only — a report with errors is refused)."},"xbrl_mode_notice":{"type":"string","description":"Legacy mode notice."}},"required":["filing_reference","submission_id","status"]},"XbrlValidationFinding":{"type":"object","properties":{"rule_id":{"type":"string","description":"Rule id from the rules file (PKG-0xx, XBRL-0xx/1xx, CALC-0xx, DUP-0xx, FRA-1xx, DQ-0xx, FRA-00x, FRA_INS_SOLVENCY)."},"layer":{"type":"string","enum":["package","xbrl","calculation","duplicates","filing","data_quality","business"]},"severity":{"type":"string","enum":["error","warning","info"]},"message":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}},"required":["ar","en"]},"concept":{"type":"string","description":"Element QName (platform prefixes: ifrs-full, fra, fra-ins…)."},"context":{"type":"string"},"period":{"type":"string"},"unit":{"type":"string"},"value":{"type":"string"},"field":{"type":"string","description":"Template field key."},"path":{"type":"string","description":"Path inside the package."},"arelle_code":{"type":"string","description":"Arelle message code (layer xbrl)."},"document":{"type":"string","description":"Document of an Inline XBRL document set."},"source":{"type":"string","description":"arelle when the finding comes from Arelle."}},"required":["rule_id","layer","severity","message"]},"XbrlValidationReport":{"type":"object","properties":{"report_version":{"type":"string","const":"1.0"},"rules_version":{"type":"string","description":"Version of the rules file the report was checked against."},"valid":{"type":"boolean","description":"No error: the report would be accepted."},"status":{"type":"string","enum":["passed","warnings","failed"]},"summary":{"type":"object","properties":{"errors":{"type":"integer"},"warnings":{"type":"integer"},"info":{"type":"integer"}},"required":["errors","warnings","info"]},"layers":{"type":"array","items":{"type":"object","properties":{"layer":{"type":"string"},"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"status":{"type":"string","enum":["passed","warnings","failed","skipped","not_configured","disabled"]},"errors":{"type":"integer"},"warnings":{"type":"integer"},"detail":{"type":"object","description":"Layer details (Arelle mode and version, checks counted…).","additionalProperties":true}},"required":["layer","status","errors","warnings"]}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/XbrlValidationFinding"}},"report":{"type":"object","properties":{"file_name":{"type":"string"},"file_sha256":{"type":"string"},"format":{"type":"string","enum":["ixbrl","ixbrl-set","xbrl-xml","xbrl-json","xbrl-csv","unknown"]},"documents":{"type":"array","items":{"type":"string"}},"schema_refs":{"type":"array","items":{"type":"string"}},"entry_point":{"type":["string","null"]},"taxonomy_version":{"type":["string","null"]},"entity":{"type":["object","null"],"properties":{"scheme":{"type":"string"},"id":{"type":"string"}}},"facts":{"type":"integer"}}},"mapping":{"type":["object","null"],"properties":{"template_code":{"type":"string"},"framework":{"type":"string"},"fiscal_year":{"type":"integer"},"figures":{"type":"integer","description":"Template rows filled."},"unmapped":{"type":"integer"},"dimensional_not_transferred":{"type":"integer"}}},"generated_at":{"type":"string","format":"date-time"}},"required":["report_version","rules_version","valid","status","summary","layers","findings"],"description":"Layered validation report of an XBRL report (Channel D)."},"XbrlTestFilingRequest":{"type":"object","properties":{"file_name":{"type":"string","description":"e.g. FRA-LIC-0001-2025-12-31-annual.xbri","maxLength":200},"content_base64":{"type":"string","description":"The report or report package bytes.","contentEncoding":"base64"},"template_code":{"type":"string","description":"Only when the report references no FRA template entry point."},"fiscal_year":{"type":"integer","minimum":1990,"maximum":2100}},"required":["file_name","content_base64"]},"XbrlTestFilingResult":{"type":"object","properties":{"environment":{"type":"string","enum":["sandbox","production"]},"filed":{"type":"boolean","const":false},"run_id":{"type":"integer","description":"Stored validation run (audit)."},"validation":{"$ref":"#/components/schemas/XbrlValidationReport"}},"required":["environment","filed","validation"]},"XbrlValidationFailed":{"type":"object","properties":{"error":{"type":"string","enum":["xbrl_validation_failed"]},"message":{"type":"string"},"xbrl_mode":{"type":"string","const":"standard"},"validation":{"$ref":"#/components/schemas/XbrlValidationReport"}},"required":["error","validation"],"description":"The XBRL report was refused; nothing was filed."},"SubmissionNotReady":{"type":"object","properties":{"error":{"type":"string","const":"submission_not_ready"},"message":{"type":"string"},"filing_reference":{"type":"string"},"submission_id":{"type":"integer"},"status":{"type":"string","const":"draft"},"blocking":{"type":"array","items":{"type":"object","properties":{"gate":{"type":"string","enum":["checklist","attestation","approval"]},"messages":{"type":"array","items":{"type":"string"}}}}},"sandbox":{"type":"boolean"}},"required":["error","filing_reference","status","blocking"],"description":"Stored as a draft; the company completes it in the portal."},"StructuredFilingResult":{"type":"object","properties":{"filing_reference":{"type":"string"},"submission_id":{"type":"integer"},"figures":{"type":"integer","description":"Figures bound (current + prior)."},"values_hash":{"type":"string","description":"Canonical hash of the figures as filed (what an auditor seal covers)."},"warnings":{"type":"array","items":{"type":"object","description":"e.g. total_mismatch, required_missing.","additionalProperties":true}},"status":{"type":"string","enum":["draft","received"]},"message":{"type":"string"},"sandbox":{"type":"boolean"},"simulated_status":{"type":"string"},"simulated_gates":{"type":"array","items":{"type":"string"}}},"required":["filing_reference","submission_id","status"]},"InvalidFigures":{"type":"object","properties":{"error":{"type":"string","const":"invalid_figures"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"field_key":{"type":"string"},"concept":{"type":"string"},"error":{"type":"string","enum":["unknown_field_key","unknown_concept","ambiguous_concept","not_a_number","duplicate_field","text_field_in_figures","numeric_field_in_text","missing_field_key_or_concept","no_figures"]},"candidates":{"type":"array","items":{"type":"string"}},"period":{"type":"string"}}}}},"required":["error","errors"]},"FromExtractionRequest":{"type":"object","properties":{"template_id":{"type":"integer"},"period_start":{"type":"string","format":"date"},"period_end":{"type":"string","format":"date"},"fiscal_year":{"type":"integer","minimum":2000,"maximum":2100},"quarter":{"type":["integer","null"],"minimum":1,"maximum":4},"extracted_data":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","description":"Line-item label."},"value":{"type":["number","null"]},"type":{"type":["string","null"]},"section":{"type":["string","null"]}},"required":["item"]},"description":"At least one item."},"source":{"type":["string","null"],"maxLength":100},"ai_model":{"type":["string","null"],"maxLength":100}},"required":["template_id","period_start","period_end","fiscal_year","extracted_data"]},"ExtractionMappingResult":{"type":"object","properties":{"submission_id":{"type":"integer"},"filing_reference":{"type":"string"},"status":{"type":"string","enum":["draft","mapping_review"]},"mapping_summary":{"type":"object","description":"total_extracted, matched, unmatched, average_confidence, fields_by_confidence.","additionalProperties":true},"form_data":{"type":"object","description":"field_key → value.","additionalProperties":true},"dynamic_fields":{"type":"array","items":{"type":"object","description":"Unmatched item.","additionalProperties":true}},"field_map":{"type":"object","description":"Mapping detail.","additionalProperties":true}}},"FilingSummary":{"type":"object","properties":{"id":{"type":"integer"},"reference_number":{"type":"string"},"status":{"type":"string"},"period_label":{"type":"string"},"fiscal_year":{"type":["integer","null"]},"quarter":{"type":["integer","null"]},"source":{"type":"string"},"is_test":{"type":"boolean","description":"Sandbox filing."},"submitted_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"template":{"type":["object","null"],"properties":{"id":{"type":"integer"},"code":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string"}}}},"description":"The filing row (additional columns may appear)."},"FilingList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FilingSummary"}},"total":{"type":"integer"},"page":{"type":"integer"}}},"FilingFigure":{"type":"object","properties":{"fig_id":{"type":["string","null"],"description":"Stable figure id within the filing."},"label":{"type":["string","null"],"description":"Line label as read (Arabic when available)."},"statement":{"type":["string","null"],"description":"Statement code, e.g. SFP, PL, OCI, CF, SCE or a note."},"period":{"type":["string","null"],"description":"Period context, e.g. current / prior."},"year":{"type":["integer","null"]},"value":{"type":"number"},"page":{"type":["integer","null"],"description":"Source PDF page (1-based)."},"row_y":{"type":["number","null"],"description":"Vertical position of the row on the page."},"bbox":{"type":["array","null"],"items":{"type":"number"},"description":"Bounding box of the figure on the page."},"bbox_source":{"type":["string","null"],"description":"How the bounding box was obtained."},"dr_status":{"type":["string","null"],"description":"Data-reconciliation status of the figure."},"verdict":{"type":["string","null"],"description":"Per-figure verdict.","enum":["read_correctly","corrected_with_evidence","suspect","unreadable",null]},"evidence":{"type":["object","array","null"],"description":"The evidence the verdict rests on."}},"required":["value"]},"FilingFigures":{"type":"object","properties":{"filing_reference":{"type":"string"},"verdicts_available":{"type":"boolean","description":"True once data reconciliation has run on the filing."},"verdict_values":{"type":"array","items":{"type":"string","enum":["read_correctly","corrected_with_evidence","suspect","unreadable"]}},"summary":{"type":["object","null"],"properties":{"total":{"type":"integer"},"counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Figures per verdict."},"face":{"type":"object","additionalProperties":{"type":"integer"},"description":"Primary-statement figures per verdict."},"notes":{"type":"object","additionalProperties":{"type":"integer"},"description":"Note figures per verdict."}}},"figures":{"type":"array","items":{"$ref":"#/components/schemas/FilingFigure"}}},"required":["filing_reference","verdicts_available","figures"]},"FilingStatus":{"type":"object","properties":{"filing_reference":{"type":"string"},"status":{"type":"string","description":"draft | mapping_review | submitted | fra_assigned | fra_under_review | accepted | rejected | requires_amendment | …"},"sandbox":{"type":"boolean"},"template":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string"}}},"period_label":{"type":"string"},"validation_status":{"type":"string"},"validation_errors":{"type":"array","items":{"type":"object","description":"Error.","additionalProperties":true}},"validation_warnings":{"type":"array","items":{"type":"object","description":"Warning.","additionalProperties":true}},"inspector_assigned":{"type":"boolean"},"inspector_name":{"type":["string","null"]},"review_notes":{"type":["string","null"]},"review_started_at":{"type":["string","null"],"format":"date-time"},"review_completed_at":{"type":["string","null"],"format":"date-time"},"ai_review":{"type":["object","null"],"properties":{"compliance_score":{"type":["number","null"]},"risk_level":{"type":"string"},"suggested_decision":{"type":"string"}}},"penalty_amount":{"type":["number","string","null"]},"is_amendment":{"type":["boolean","null"]},"resubmission_count":{"type":["integer","null"]},"submitted_at":{"type":["string","null"],"format":"date-time"},"last_updated_at":{"type":["string","null"],"format":"date-time"}},"required":["filing_reference","status"]},"AttachmentRequest":{"allOf":[{"$ref":"#/components/schemas/EncryptedEnvelope"},{"type":"object","properties":{"fra_key_version":{"type":"integer"},"filename":{"type":"string","description":"Letters, digits, spaces, . _ - only.","maxLength":255},"content_type":{"type":"string","maxLength":100},"checksum_sha256":{"type":"string","description":"Hex SHA-256 of the file."}},"required":["fra_key_version","filename","content_type","checksum_sha256"]}]},"AttachmentReceived":{"type":"object","properties":{"attachment_id":{"type":"integer"},"filename":{"type":"string"},"file_size":{"type":"integer"},"status":{"type":"string","const":"received"},"timestamp":{"type":"string","format":"date-time"}}},"DisclosureEnvelope":{"type":"object","properties":{"disclosure_id":{"type":"string","description":"ULID chosen by the issuer."},"envelope_version":{"type":"string","description":"Default 1.0."},"company_id":{"type":"string","description":"Issuer company identifier."},"category":{"type":"string","description":"Disclosure category."},"language":{"type":"string","enum":["ar","en"]},"submitted_at":{"type":"string","description":"Within ±5 min of FRA time.","format":"date-time"},"period":{"type":"object","properties":{"start":{"type":["string","null"],"format":"date"},"end":{"type":["string","null"],"format":"date"},"fiscal_year":{"type":["integer","null"]},"quarter":{"type":["integer","null"]}}},"figures":{"type":"array","items":{"type":"object","description":"Figure.","additionalProperties":true}},"quotes":{"type":"array","items":{"type":"object","description":"Quote.","additionalProperties":true}},"attachments":{"type":"array","items":{"type":"object","description":"Attachment reference.","additionalProperties":true}},"promises":{"type":"array","items":{"type":"object","description":"Forward-looking statement.","additionalProperties":true}},"audit":{"type":"object","properties":{"ir_validation_hash":{"type":"string","description":"SHA-256 of canonical {figures, quotes, promises}."}}},"signatures":{"type":"object","properties":{"issuer_sig":{"type":"string","description":"Signature over the canonical JSON without `signatures`."},"issuer_cert_thumbprint":{"type":"string"}}}},"required":["disclosure_id","company_id","category","submitted_at"]},"DisclosureReceived":{"type":"object","properties":{"data":{"type":"object","properties":{"tracking_id":{"type":"string"},"status":{"type":"string"},"received_at":{"type":["string","null"],"format":"date-time"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/RuleFlag"}}}}}},"DisclosureStatus":{"type":"object","properties":{"data":{"type":"object","properties":{"tracking_id":{"type":"string"},"status":{"type":"string"},"received_at":{"type":["string","null"],"format":"date-time"},"approved_at":{"type":["string","null"],"format":"date-time"},"published_at":{"type":["string","null"],"format":"date-time"},"rejected_at":{"type":["string","null"],"format":"date-time"},"rejection_reason":{"type":["string","null"]},"flags_count":{"type":"object","properties":{"critical":{"type":"integer"},"warning":{"type":"integer"},"info":{"type":"integer"}}}}}}},"RuleFlag":{"type":"object","properties":{"rule_id":{"type":"string"},"severity":{"type":"string","enum":["critical","warning","info"]},"title":{"type":"string"},"citation":{"type":["string","null"]}},"description":"A rule finding (further fields may appear)."},"CanonicalRule":{"type":"object","description":"Canonical rule: id, category, severity, titles, formula/condition, citation, versioning.","additionalProperties":true},"Decree":{"type":"object","description":"Decree or circular: id, number, date, titles, articles.","additionalProperties":true},"PageMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"},"served_at":{"type":["string","null"],"format":"date-time"}}},"DeadlineList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"template_code":{"type":["string","null"]},"template_name":{"type":["string","null"]},"period_label":{"type":["string","null"]},"period_start":{"type":["string","null"],"format":"date"},"period_end":{"type":["string","null"],"format":"date"},"deadline_date":{"type":["string","null"],"format":"date"},"status":{"type":"string"},"is_overdue":{"type":"boolean"},"days_until":{"type":["integer","null"]},"penalty_amount":{"type":["number","string","null"]},"submission_id":{"type":["integer","null"]},"notes":{"type":["string","null"]}}}},"meta":{"type":"object","properties":{"total":{"type":"integer"},"overdue":{"type":"integer"}}}}},"ReportingPeriodList":{"type":"object","properties":{"year":{"type":"integer"},"count":{"type":"integer"},"periods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"period_name_ar":{"type":"string"},"period_name_en":{"type":["string","null"]},"period_type":{"type":"string"},"period_type_label":{"type":"string"},"fiscal_year":{"type":"integer"},"start_date":{"type":["string","null"],"format":"date"},"end_date":{"type":["string","null"],"format":"date"},"submission_deadline":{"type":["string","null"],"format":"date"},"extended_deadline":{"type":["string","null"],"format":"date"},"effective_deadline":{"type":["string","null"],"format":"date"},"applies_to":{"type":"array","items":{"type":"string"}},"days_until_deadline":{"type":["integer","null"]},"deadline_status":{"type":"string"},"notes_ar":{"type":["string","null"]}}}}}},"ComplianceHistory":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"score":{"type":"number"},"previous_score":{"type":["number","null"]},"change":{"type":["number","null"]},"direction":{"type":"string"},"reason":{"type":"string"},"reason_label":{"type":"string"},"component_scores":{"type":["object","null"],"description":"Component → score.","additionalProperties":true},"date":{"type":["string","null"],"format":"date"},"timestamp":{"type":["string","null"],"format":"date-time"}}}},"meta":{"type":"object","properties":{"company_id":{"type":"string"},"company_name":{"type":"string"},"from":{"type":["string","null"],"format":"date"},"to":{"type":["string","null"],"format":"date"},"count":{"type":"integer"},"latest_score":{"type":["number","null"]}}}}},"Template":{"type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string"},"name":{"type":"string"},"name_ar":{"type":"string"},"description":{"type":["string","null"]},"filing_frequency":{"type":"string"},"sector_codes":{"type":["array","null"],"items":{"type":"string"}},"submission_window_days":{"type":["integer","null"]},"requires_xbrl":{"type":"boolean"},"requires_auditor_sign":{"type":["boolean","null"]},"version":{"type":["string","null"]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/TemplateField"}}},"description":"Template (resource fields may vary by endpoint)."},"TemplateField":{"type":"object","properties":{"field_key":{"type":"string"},"label":{"type":"string"},"label_ar":{"type":"string"},"field_type":{"type":"string","description":"currency, number, decimal, percentage, text, …"},"section":{"type":["string","null"]},"section_ar":{"type":["string","null"]},"is_required":{"type":["boolean","null"]},"options":{"type":["array","object","null"]},"xbrl_concept":{"type":["string","null"]},"sort_order":{"type":["integer","null"]}},"required":["field_key"]},"TemplateSync":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Template"},{"type":"object","properties":{"category":{"type":["string","null"]},"updated_at":{"type":["string","null"],"format":"date-time"}}}]}},"total":{"type":"integer"},"synced_at":{"type":["string","null"],"format":"date-time"}}},"TemplateValidators":{"type":"object","properties":{"template_id":{"type":"integer"},"template_code":{"type":"string"},"validators":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"category":{"type":"string"},"label_ar":{"type":"string"},"label_en":{"type":["string","null"]},"formula":{"type":"string"},"tolerance_percent":{"type":["number","string","null"]},"severity":{"type":"string"},"is_error":{"type":"boolean"}}}}}},"Taxonomy":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"name_ar":{"type":["string","null"]},"namespace":{"type":"string"},"version":{"type":"string"},"type":{"type":"string"},"sector_codes":{"type":["array","null"],"items":{"type":"string"}}}},"TaxonomyConcept":{"type":"object","properties":{"id":{"type":"integer"},"qname":{"type":"string"},"label_en":{"type":["string","null"]},"label_ar":{"type":["string","null"]},"data_type":{"type":["string","null"]},"period_type":{"type":["string","null"]}}},"AccessRequest":{"type":"object","properties":{"company_name":{"type":"string","maxLength":255},"company_name_ar":{"type":["string","null"]},"fra_license_number":{"type":["string","null"]},"sector_code":{"type":["string","null"]},"entity_type":{"type":["string","null"],"enum":["listed_company","nbfi","insurance","mortgage","leasing","factoring","microfinance","consumer_finance","fintech","securitization","other"]},"contact_name":{"type":"string"},"contact_email":{"type":"string","format":"email"},"contact_phone":{"type":["string","null"]},"rsa_public_key":{"type":["string","null"],"description":"PEM."},"webhook_url":{"type":["string","null"],"format":"uri"},"ir_system_base_url":{"type":"string","format":"uri"},"notes":{"type":["string","null"],"maxLength":2000}},"required":["company_name","contact_name","contact_email","ir_system_base_url"]},"AccessRequestCreated":{"type":"object","properties":{"request_id":{"type":"integer"},"status":{"type":"string","const":"pending"},"message":{"type":"string"},"timestamp":{"type":["string","null"],"format":"date-time"}}},"AccessRequestStatus":{"type":"object","properties":{"request_id":{"type":"integer"},"status":{"type":"string"},"company_name":{"type":"string"},"submitted_at":{"type":["string","null"],"format":"date-time"},"reviewed_at":{"type":["string","null"],"format":"date-time"},"review_notes":{"type":["string","null"]},"credentials":{"type":"object","properties":{"client_id":{"type":"string"},"fra_base_url":{"type":"string"},"tenant_created":{"type":"boolean"}}}}},"StatsOverview":{"type":"object","properties":{"total_tenants":{"type":"integer"},"active_tenants":{"type":"integer"},"total_submissions_ytd":{"type":"integer"},"acceptance_rate":{"type":"number"},"last_updated":{"type":["string","null"],"format":"date-time"}}},"StatsSector":{"type":"object","properties":{"sector_id":{"type":"integer"},"sector_name_ar":{"type":"string"},"sector_name_en":{"type":"string"},"tenant_count":{"type":"integer"},"submission_count_ytd":{"type":"integer"},"acceptance_rate":{"type":"number"}}},"StatsMonth":{"type":"object","properties":{"month":{"type":"string"},"submissions":{"type":"integer"},"accepted":{"type":"integer"},"rate":{"type":"number"}}},"StatsCompany":{"type":"object","properties":{"fra_license_number":{"type":"string"},"company_name_ar":{"type":"string"},"sector":{"type":["string","null"]},"compliance_score":{"type":"number"},"submissions_count":{"type":"integer"}}},"Fact":{"type":"object","properties":{"id":{"type":"integer"},"concept":{"type":"string","description":"QName."},"value":{"type":["string","null"],"description":"Reported value (natural XBRL sign)."},"numeric_value":{"type":["number","null"]},"unit":{"type":["string","null"],"description":"e.g. iso4217:EGP."},"decimals":{"type":["integer","null"]},"period":{"type":"object","properties":{"type":{"type":"string","enum":["instant","duration"]},"start":{"type":["string","null"],"format":"date"},"end":{"type":["string","null"],"format":"date"},"instant":{"type":["string","null"],"format":"date"},"context":{"type":["string","null"],"enum":["current","prior"]}}},"dimensions":{"type":"object","additionalProperties":{"type":"string"},"description":"Axis → member."},"labels":{"type":"object","properties":{"ar":{"type":["string","null"]},"en":{"type":["string","null"]}}},"statement":{"type":["string","null"]},"company":{"type":"object","properties":{"name_ar":{"type":["string","null"]},"name_en":{"type":["string","null"]},"license":{"type":["string","null"]},"lei":{"type":["string","null"]},"sector":{"type":["object","null"],"properties":{"code":{"type":"string"},"name_ar":{"type":["string","null"]},"name_en":{"type":["string","null"]}}}}},"filing":{"type":"object","properties":{"reference":{"type":"string"},"template":{"type":["string","null"]},"fiscal_year":{"type":["integer","null"]},"period":{"type":"string","enum":["FY","Q1","Q2","Q3","Q4"]},"period_label":{"type":["string","null"]},"accepted_at":{"type":["string","null"],"format":"date-time"},"historical":{"type":"boolean","description":"Migrated from the legacy system."},"links":{"type":"object","additionalProperties":{"type":"string","format":"uri"},"description":"ixbrl, report_package, xbrl_xml, xbrl_json, xbrl_csv, xbrl_csv_package, viewer, validation."}}}},"required":["id","concept","value","period","company","filing"]},"FactPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fact"}},"meta":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"last_page":{"type":"integer"},"filters":{"type":"object","description":"Applied filters.","additionalProperties":true},"classification":{"type":"string"},"generated_at":{"type":["string","null"],"format":"date-time"}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":["string","null"]},"prev":{"type":["string","null"]},"bulk":{"type":"string"},"dictionary":{"type":"string"}}}}},"PublicSearchPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"kind":{"type":"string","enum":["filing","note","figure"]},"locale":{"type":"string","enum":["ar","en","mul"]},"title":{"type":"string"},"title_html":{"type":"string","description":"Title, HTML-escaped, matches in <mark>."},"snippet_html":{"type":"string","description":"Excerpt around the first match, HTML-escaped, matches in <mark>."},"score":{"type":"number"},"filing":{"type":"object","properties":{"id":{"type":"integer"},"reference":{"type":["string","null"]},"company":{"type":"object","properties":{"name_ar":{"type":["string","null"]},"name_en":{"type":["string","null"]},"license":{"type":["string","null"]},"lei":{"type":["string","null"]}}},"sector":{"type":["string","null"]},"template":{"type":["string","null"]},"fiscal_year":{"type":["integer","null"]},"period":{"type":["string","null"]},"period_label":{"type":["string","null"]},"accepted_at":{"type":["string","null"],"format":"date-time"},"links":{"type":"object","description":"ixbrl, report_package, xbrl_xml, xbrl_json, xbrl_csv, xbrl_csv_package, viewer, validation, validation_report, validation_report_json.","additionalProperties":true}}}}}},"meta":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"last_page":{"type":"integer"},"query":{"type":"string"},"filters":{"type":"object","description":"Applied filters.","additionalProperties":true},"engine":{"type":"string","enum":["fulltext","like"]},"classification":{"type":"string"},"normalization":{"type":"string"}}},"links":{"type":"object","properties":{"next":{"type":["string","null"]},"prev":{"type":["string","null"]}}}}},"PublicFilingValidation":{"type":"object","properties":{"filing":{"type":"object","description":"id, reference, company {name_ar, name_en, license, lei}, template, fiscal_year, period, accepted_at, links.","additionalProperties":true},"status":{"type":"string","enum":["valid","warnings","errors","not_available"]},"validation":{"$ref":"#/components/schemas/XbrlValidationReport"}}},"PublicXbrlCheckResult":{"type":"object","properties":{"filed":{"type":"boolean","const":false},"stored":{"type":"boolean","const":false},"validation":{"$ref":"#/components/schemas/XbrlValidationReport"}}},"BulkFileList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"year":{"type":"integer"},"format":{"type":"string","enum":["csv","json"]},"name":{"type":"string"},"rows":{"type":"integer"},"bytes":{"type":"integer"},"sha256":{"type":"string"},"generated_at":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","format":"uri"}}}},"meta":{"type":"object","properties":{"generated_at":{"type":["string","null"],"format":"date-time"},"taxonomy":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"}},"dictionary":{"type":"string"}}}}},"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"]},"system":{"type":"string"},"timestamp":{"type":["string","null"],"format":"date-time"}}},"WebhookPayload":{"type":"object","properties":{"event":{"type":"string"},"filing_reference":{"type":"string"},"old_status":{"type":"string"},"new_status":{"type":"string"},"review_notes":{"type":["string","null"]},"timestamp":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","description":"Event-specific details.","additionalProperties":true}},"required":["event"],"description":"Event body (fields depend on the event)."}}}}