Return the Enterprise Action Auth Token for the active organization.
(self)
| 32 | CLI_INTEGRATION_TOKEN_RESOURCE = "/crewai_plus/api/v1/me/integration-token" # noqa: S105 - API path, not a secret |
| 33 | |
| 34 | def get_integration_token(self) -> str: |
| 35 | """Return the Enterprise Action Auth Token for the active organization.""" |
| 36 | response = self._make_request( |
| 37 | "GET", self.CLI_INTEGRATION_TOKEN_RESOURCE, timeout=30 |
| 38 | ) |
| 39 | response.raise_for_status() |
| 40 | payload = response.json() |
| 41 | token = payload.get("api_key") if isinstance(payload, dict) else None |
| 42 | if not isinstance(token, str) or not token: |
| 43 | raise RuntimeError("AMP did not return an integration token") |
| 44 | return token |
| 45 | |
| 46 | def create_evaluation( |
| 47 | self, |