{
  "openapi": "3.0.3",
  "info": {
    "title": "Certifixe Connect API",
    "version": "1.0.0",
    "description": "API do ecossistema Certifixe. Autenticação: `Authorization: Bearer <chave ou token>`. Chaves `cfx_test_` usam o sandbox, com dados fictícios. Erros: `{\"error\": {\"code\", \"message\", \"request_id\"}}`. Cada resposta traz `X-Request-Id` e `X-RateLimit-Remaining`. Versionamento: alterações incompatíveis vão para /api/v2/; a v1 mantém-se, e campos novos podem ser acrescentados, por isso ignore os que não conhecer."
  },
  "servers": [
    {
      "url": "https://certifixe.com"
    }
  ],
  "paths": {
    "/api/v1/": {
      "get": {
        "tags": [
          "Geral"
        ],
        "summary": "Estado da credencial: aplicação, ambiente e escopos",
        "description": "Estado da credencial: aplicação, ambiente e escopos",
        "parameters": [],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "api": "Certifixe Connect",
                  "version": "v1",
                  "sandbox": false,
                  "scopes": [
                    "certificates:verify"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/certificates/verify/": {
      "post": {
        "tags": [
          "Certificados"
        ],
        "summary": "Verificar um certificado: autenticidade, estado e emissor",
        "description": "Verificar um certificado: autenticidade, estado e emissor. O titular vai sempre parcial; `holder_name` só confirma se o nome coincide.",
        "parameters": [],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "status": "valid",
                  "authentic": true,
                  "code": "CFX-2026-AB12-CD34",
                  "document_type": "conclusao",
                  "holder": "Joana M.",
                  "issuer": {
                    "name": "Centro Exemplo",
                    "license_status": "validada",
                    "license_number": "0170.01/2018"
                  },
                  "certificate": {
                    "number": "CF-2026-0012",
                    "course": "Informática",
                    "hours": 60,
                    "completed_on": "2026-06-30",
                    "issued_on": "2026-07-02"
                  },
                  "integrity_seal": "A1B2-C3D4",
                  "verify_url": "https://certifixe.com/verificar-certificado/CFX-2026-AB12-CD34/",
                  "holder_name_matches": true
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "certificates:verify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "code": "CFX-2026-AB12-CD34",
                "holder_name": "Joana Manuel"
              }
            }
          }
        }
      }
    },
    "/api/v1/certificates/issuances/": {
      "post": {
        "tags": [
          "Certificados"
        ],
        "summary": "Emitir um certificado para uma matrícula ou participante existente do centro que autorizou a aplicação",
        "description": "Emitir um certificado para uma matrícula ou participante existente do centro que autorizou a aplicação. Assíncrono: acompanhe o estado. Planos Business e Enterprise.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 80
            },
            "description": "Único por emissão: repetir o pedido devolve a mesma emissão, sem emitir duas vezes."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "202": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "6f1f7e1c-6a1e-4d7b-9f58-0d3f0c7d2b11",
                  "type": "completion",
                  "reference_id": 512,
                  "status": "pending",
                  "reasons": [],
                  "code": null,
                  "number": null,
                  "institution": "centro-exemplo",
                  "created_at": "2026-11-04T10:00:00+01:00",
                  "updated_at": "2026-11-04T10:00:00+01:00"
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: chave repetida com outros dados",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "422": {
            "description": "`holder_mismatch`: o nome não coincide com o registo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "certificates:issue",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "type": "completion",
                "reference_id": 512,
                "holder_name": "Joana Manuel",
                "institution": "centro-exemplo"
              }
            }
          }
        }
      }
    },
    "/api/v1/certificates/issuances/{emissao_id}/": {
      "get": {
        "tags": [
          "Certificados"
        ],
        "summary": "Estado da emissão: pending, processing, issued ou rejected (com os motivos, as mesmas regras do sistema)",
        "description": "Estado da emissão: pending, processing, issued ou rejected (com os motivos, as mesmas regras do sistema).",
        "parameters": [
          {
            "name": "emissao_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "6f1f7e1c-6a1e-4d7b-9f58-0d3f0c7d2b11",
                  "type": "completion",
                  "reference_id": 512,
                  "status": "issued",
                  "reasons": [],
                  "code": "CFX-2026-AB12-CD34",
                  "number": "CF-2026-0012",
                  "institution": "centro-exemplo",
                  "created_at": "2026-11-04T10:00:00+01:00",
                  "updated_at": "2026-11-04T10:00:00+01:00"
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "certificates:issue"
      }
    },
    "/api/v1/certificates/issuances/{emissao_id}/document/": {
      "get": {
        "tags": [
          "Certificados"
        ],
        "summary": "Descarregar o PDF de uma emissão concluída",
        "description": "Descarregar o PDF de uma emissão concluída.",
        "parameters": [
          {
            "name": "emissao_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "O PDF",
            "content": {
              "application/pdf": {}
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "409": {
            "description": "`not_ready`: ainda não emitido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "certificates:issue"
      }
    },
    "/api/v1/institution/enrollments/": {
      "get": {
        "tags": [
          "Instituição"
        ],
        "summary": "Matrículas do centro que autorizou a aplicação, para obter o `reference_id`",
        "description": "Matrículas do centro que autorizou a aplicação, para obter o `reference_id`.",
        "parameters": [
          {
            "name": "institution",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug do centro, se a aplicação tiver vários"
          },
          {
            "name": "class",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Id da turma"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Estado da matrícula"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Página (a partir de 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Itens por página, até 100"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": 512,
                      "holder_name": "Joana Manuel",
                      "class": "INFO 07H",
                      "course": "Informática",
                      "status": "ativa"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 25,
                    "total": 1,
                    "has_next": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "institution:read"
      }
    },
    "/api/v1/institution/workshop-participants/": {
      "get": {
        "tags": [
          "Instituição"
        ],
        "summary": "Participantes de workshops do centro que autorizou a aplicação",
        "description": "Participantes de workshops do centro que autorizou a aplicação.",
        "parameters": [
          {
            "name": "institution",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Slug do centro, se a aplicação tiver vários"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Página (a partir de 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Itens por página, até 100"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": 77,
                      "holder_name": "Ana Paula",
                      "event": "Oficina de Excel",
                      "status": "confirmada"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 25,
                    "total": 1,
                    "has_next": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "institution:read"
      }
    },
    "/api/v1/identity/verify/": {
      "post": {
        "tags": [
          "Identidade"
        ],
        "summary": "Confirmar se um identificador do Certifixe ID existe",
        "description": "Confirmar se um identificador do Certifixe ID existe. Sem dados da pessoa.",
        "parameters": [],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "exists": true
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "identity:verify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "identifier": "4yp3-nmhf"
              }
            }
          }
        }
      }
    },
    "/api/v1/identity/me/": {
      "get": {
        "tags": [
          "Identidade"
        ],
        "summary": "Perfil da pessoa que autorizou (token OAuth)",
        "description": "Perfil da pessoa que autorizou (token OAuth).",
        "parameters": [],
        "security": [
          {
            "oauth2": [
              "identity:profile"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "identifier": "4yp3-nmhf",
                  "name": "Joana Manuel",
                  "title": "Técnica de Contabilidade",
                  "municipality": "Talatona",
                  "province": "luanda",
                  "updated_at": "2026-11-01T09:00:00+01:00"
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "identity:profile"
      }
    },
    "/api/v1/identity/me/credentials/": {
      "get": {
        "tags": [
          "Identidade"
        ],
        "summary": "Certificados visíveis da pessoa, com a origem e o estado",
        "description": "Certificados visíveis da pessoa, com a origem e o estado. Nunca documentos nem BI.",
        "parameters": [],
        "security": [
          {
            "oauth2": [
              "identity:credentials"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "source": "certifixe",
                      "status": "verificado_certifixe",
                      "type": "Certificado de conclusão",
                      "title": "Informática",
                      "institution": "Centro Exemplo",
                      "number": "CF-2026-0012",
                      "date": "2026-07-02",
                      "hours": 60,
                      "verification_code": "CFX-2026-AB12-CD34",
                      "area": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "identity:credentials"
      }
    },
    "/api/v1/identity/me/skills/": {
      "get": {
        "tags": [
          "Identidade"
        ],
        "summary": "Competências da pessoa; `documented_by_certificate` distingue as documentadas das só declaradas",
        "description": "Competências da pessoa; `documented_by_certificate` distingue as documentadas das só declaradas.",
        "parameters": [],
        "security": [
          {
            "oauth2": [
              "identity:skills"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "name": "Excel avançado",
                      "kind": "competencia",
                      "level": "avancado",
                      "documented_by_certificate": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "identity:skills"
      }
    },
    "/api/v1/identity/me/resumes/": {
      "get": {
        "tags": [
          "Identidade"
        ],
        "summary": "Currículos da pessoa, para escolher o `resume_id` de uma candidatura",
        "description": "Currículos da pessoa, para escolher o `resume_id` de uma candidatura.",
        "parameters": [],
        "security": [
          {
            "oauth2": [
              "applications:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": 12,
                      "name": "O meu currículo"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "applications:read"
      }
    },
    "/api/v1/identity/me/applications/": {
      "get": {
        "tags": [
          "Careers"
        ],
        "summary": "Candidaturas da pessoa que autorizou",
        "description": "Candidaturas da pessoa que autorizou.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Página (a partir de 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Itens por página, até 100"
          }
        ],
        "security": [
          {
            "oauth2": [
              "applications:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": 8,
                      "job_id": "contabilista-a1b2",
                      "job_title": "Contabilista Júnior",
                      "company": "Banco Exemplo",
                      "status": "em_analise",
                      "submitted_at": "2026-11-01T09:00:00+01:00",
                      "updated_at": "2026-11-02T09:00:00+01:00"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 25,
                    "total": 1,
                    "has_next": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "applications:read"
      }
    },
    "/api/v1/jobs/": {
      "get": {
        "tags": [
          "Careers"
        ],
        "summary": "Vagas publicadas por empresas verificadas",
        "description": "Vagas publicadas por empresas verificadas.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Texto livre"
          },
          {
            "name": "area",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Área profissional"
          },
          {
            "name": "province",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Província"
          },
          {
            "name": "work_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "presencial, remoto ou hibrido"
          },
          {
            "name": "contract_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Tipo de contrato"
          },
          {
            "name": "company",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Id da empresa"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Página (a partir de 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Itens por página, até 100"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": "contabilista-a1b2",
                      "title": "Contabilista Júnior",
                      "company": {
                        "id": "banco-exemplo-c3d4",
                        "name": "Banco Exemplo"
                      },
                      "area": "Finanças",
                      "province": "luanda",
                      "municipality": "Talatona",
                      "work_mode": "hibrido",
                      "contract_type": "efetivo",
                      "experience_level": "junior",
                      "min_education": "curso",
                      "skills": [
                        "Excel"
                      ],
                      "salary": {
                        "min": null,
                        "max": null,
                        "currency": "AOA"
                      },
                      "deadline": null,
                      "published_at": "2026-11-01T09:00:00+01:00"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 25,
                    "total": 1,
                    "has_next": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "jobs:read"
      }
    },
    "/api/v1/jobs/{vaga_id}/": {
      "get": {
        "tags": [
          "Careers"
        ],
        "summary": "Detalhe de uma vaga publicada",
        "description": "Detalhe de uma vaga publicada.",
        "parameters": [
          {
            "name": "vaga_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "contabilista-a1b2",
                  "title": "Contabilista Júnior",
                  "company": {
                    "id": "banco-exemplo-c3d4",
                    "name": "Banco Exemplo"
                  },
                  "area": "Finanças",
                  "province": "luanda",
                  "municipality": "Talatona",
                  "work_mode": "hibrido",
                  "contract_type": "efetivo",
                  "experience_level": "junior",
                  "min_education": "curso",
                  "skills": [
                    "Excel"
                  ],
                  "salary": {
                    "min": null,
                    "max": null,
                    "currency": "AOA"
                  },
                  "deadline": null,
                  "published_at": "2026-11-01T09:00:00+01:00",
                  "description": "...",
                  "required": [],
                  "preferred": [],
                  "questions": [
                    {
                      "index": 0,
                      "text": "Disponibilidade?",
                      "required": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "jobs:read"
      }
    },
    "/api/v1/jobs/{vaga_id}/applications/": {
      "post": {
        "tags": [
          "Careers"
        ],
        "summary": "Candidatura em nome da pessoa (token OAuth), com o que ela autorizar nesta candidatura",
        "description": "Candidatura em nome da pessoa (token OAuth), com o que ela autorizar nesta candidatura.",
        "parameters": [
          {
            "name": "vaga_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "oauth2": [
              "applications:write"
            ]
          }
        ],
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": 8,
                  "job_id": "contabilista-a1b2",
                  "job_title": "Contabilista Júnior",
                  "company": "Banco Exemplo",
                  "status": "submetida",
                  "submitted_at": "2026-11-04T10:00:00+01:00",
                  "updated_at": "2026-11-04T10:00:00+01:00"
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`); `consent_required`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "422": {
            "description": "`application_rejected`: já se candidatou, vaga fechada, ...",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "applications:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "resume_id": 12,
                "cover_letter": "Tenho experiência...",
                "answers": {
                  "0": "Imediata"
                },
                "share_sections": [
                  "perfil",
                  "experiencia"
                ],
                "share_contacts": false,
                "consent": true
              }
            }
          }
        }
      }
    },
    "/api/v1/courses/": {
      "get": {
        "tags": [
          "Market"
        ],
        "summary": "Cursos públicos do Certifixe Market",
        "description": "Cursos públicos do Certifixe Market.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nome ou área"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Categoria"
          },
          {
            "name": "province",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Província"
          },
          {
            "name": "institution",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Id da instituição"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Página (a partir de 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Itens por página, até 100"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": 210,
                      "name": "Informática Prática",
                      "area": "Informática",
                      "institution": {
                        "id": "centro-exemplo",
                        "name": "Centro Exemplo"
                      },
                      "hours": 60,
                      "duration": {
                        "value": 2,
                        "unit": "meses"
                      },
                      "price": {
                        "enrollment": "45000.00",
                        "monthly": null,
                        "billing": "unico",
                        "currency": "AOA"
                      },
                      "category": "informatica",
                      "summary": "Do Word ao Excel."
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 25,
                    "total": 1,
                    "has_next": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "courses:read"
      }
    },
    "/api/v1/courses/{curso_id}/": {
      "get": {
        "tags": [
          "Market"
        ],
        "summary": "Detalhe de um curso, com as turmas publicadas",
        "description": "Detalhe de um curso, com as turmas publicadas.",
        "parameters": [
          {
            "name": "curso_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": 210,
                  "name": "Informática Prática",
                  "area": "Informática",
                  "institution": {
                    "id": "centro-exemplo",
                    "name": "Centro Exemplo"
                  },
                  "hours": 60,
                  "duration": {
                    "value": 2,
                    "unit": "meses"
                  },
                  "price": {
                    "enrollment": "45000.00",
                    "monthly": null,
                    "billing": "unico",
                    "currency": "AOA"
                  },
                  "category": "informatica",
                  "summary": "Do Word ao Excel.",
                  "classes": [
                    {
                      "id": 161,
                      "name": "Turma A",
                      "starts_on": "2026-12-01",
                      "ends_on": "2027-02-01",
                      "mode": "presencial",
                      "shift": "manha",
                      "days": null,
                      "seats_available": 12
                    }
                  ],
                  "description": "...",
                  "objectives": [],
                  "skills": [],
                  "requirements": null,
                  "payment_methods": []
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "courses:read"
      }
    },
    "/api/v1/courses/{curso_id}/enquiries/": {
      "post": {
        "tags": [
          "Market"
        ],
        "summary": "Enviar um pedido de informação, interesse ou inscrição para a fila da instituição",
        "description": "Enviar um pedido de informação, interesse ou inscrição para a fila da instituição. Nunca cria uma matrícula.",
        "parameters": [
          {
            "name": "curso_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": 40,
                  "course_id": 210,
                  "type": "inscricao",
                  "status": "recebida",
                  "created_at": "2026-11-04T10:00:00+01:00"
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`); `consent_required`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "422": {
            "description": "`enquiry_rejected`: dados inválidos ou pedido repetido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "enquiries:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "type": "inscricao",
                "name": "Joana Manuel",
                "phone": "923000000",
                "email": "joana@exemplo.ao",
                "message": "",
                "class_id": 161,
                "consent": true
              }
            }
          }
        }
      }
    },
    "/api/v1/institutions/": {
      "get": {
        "tags": [
          "Market"
        ],
        "summary": "Instituições públicas do Market",
        "description": "Instituições públicas do Market. `kind` distingue licenciada (com documento validado), em verificação, não licenciada e formador independente.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nome"
          },
          {
            "name": "province",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Província"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Página (a partir de 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Itens por página, até 100"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "id": "centro-exemplo",
                      "name": "Centro Exemplo",
                      "description": "...",
                      "province": "luanda",
                      "municipality": "Talatona",
                      "kind": "licenciada",
                      "label": "Instituição licenciada (INEFOP)",
                      "rating": {
                        "average": 4.6,
                        "count": 18
                      }
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "page_size": 25,
                    "total": 1,
                    "has_next": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "courses:read"
      }
    },
    "/api/v1/institutions/{slug}/": {
      "get": {
        "tags": [
          "Market"
        ],
        "summary": "Detalhe de uma instituição pública",
        "description": "Detalhe de uma instituição pública.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "centro-exemplo",
                  "name": "Centro Exemplo",
                  "description": "...",
                  "province": "luanda",
                  "municipality": "Talatona",
                  "kind": "licenciada",
                  "label": "Instituição licenciada (INEFOP)",
                  "rating": {
                    "average": 4.6,
                    "count": 18
                  }
                }
              }
            }
          },
          "400": {
            "description": "Pedido inválido (`invalid_request`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "401": {
            "description": "Sem credencial válida (`missing_credentials`, `invalid_credentials`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (`insufficient_scope`, `application_suspended`, `user_token_required`, `institution_not_authorized`, `plan_not_allowed`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado (`not_found`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          },
          "429": {
            "description": "Limite do plano atingido (`rate_limited`) ou demasiadas credenciais inválidas do mesmo IP (`too_many_failed_attempts`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erro"
                }
              }
            }
          }
        },
        "x-required-scope": "courses:read"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "cfx_live_... ou cfx_test_...",
        "description": "Chave de API da aplicação."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "Acesso delegado: Authorization Code com PKCE obrigatório. Token de 1 hora.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "/oauth/authorize/",
            "tokenUrl": "/oauth/token/",
            "refreshUrl": "/oauth/token/",
            "scopes": {
              "identity:profile": "Ver o nome, o título profissional e a localidade do seu Certifixe ID",
              "identity:credentials": "Ver os certificados visíveis do seu Certifixe ID e o estado de cada um",
              "identity:skills": "Ver as suas competências e quais estão documentadas por certificados",
              "applications:read": "Ver as suas candidaturas e os seus currículos do Certifixe",
              "applications:write": "Enviar candidaturas em seu nome, com o que autorizar em cada uma"
            }
          }
        }
      }
    },
    "schemas": {
      "Erro": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              },
              "details": {
                "type": "object"
              }
            }
          }
        }
      }
    }
  },
  "x-webhooks-events": [
    "application.created",
    "application.status_changed",
    "candidate.profile.updated",
    "certificate.created",
    "certificate.revoked",
    "certificate.updated",
    "course.published",
    "job.published"
  ]
}