# Licence

License information and management

## GET /api/v1/licence

> Returns HQ's licence.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_licence","description":"License information and management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_Licence":{"type":"object","description":"Models a licence.","properties":{"id":{"description":"Unique identifier for this licence (hex string).","type":"string"},"expires_at":{"description":"Is set to the moment HQ no longer considers this licence valid. Is\nomitted for licences that do not expire.\n","format":"date-time","type":"string"},"tier":{"$ref":"#/components/schemas/hq_LicenceTier"},"features":{"$ref":"#/components/schemas/hq_LicenceFeatures"},"limits":{"$ref":"#/components/schemas/hq_LicenceLimits"}},"required":["id","tier","features","limits"]},"hq_LicenceTier":{"type":"string","description":"Enumerates licence tiers.","enum":["community","enterprise"]},"hq_LicenceFeatures":{"type":"object","description":"Groups licence features as boolean flags.","properties":{"kafka_topic_backup_restore":{"description":"Whether Kafka topic backup and restore is enabled.","type":"boolean"},"single_sign_on":{"description":"Whether single sign-on is enabled.","type":"boolean"},"k2k":{"description":"Whether K2K (Kafka to Kafka) is enabled.","type":"boolean"},"k2k_exactly_once":{"description":"Whether K2K exactly-once semantics is enabled.","type":"boolean"},"k2k_bidirectional":{"description":"Whether K2K bidirectional replication is enabled.","type":"boolean"},"k2k_offsets_migration":{"description":"Whether K2K consumer offsets migration is enabled.","type":"boolean"},"k2k_schema_mapping":{"description":"Whether K2K schema mapping is enabled.","type":"boolean"}},"required":["kafka_topic_backup_restore","single_sign_on","k2k","k2k_exactly_once","k2k_bidirectional","k2k_offsets_migration","k2k_schema_mapping"]},"hq_LicenceLimits":{"type":"object","description":"Groups licence limits as integer values. If a field is missing or null, it means unlimited.","properties":{"iam_user":{"description":"Maximum number of IAM users allowed. If missing or null, unlimited.","type":"integer"},"iam_admin":{"description":"Maximum number of IAM admins allowed. If missing or null, unlimited.","type":"integer"},"iam_group":{"description":"Maximum number of IAM groups allowed. If missing or null, unlimited.","type":"integer"},"iam_role":{"description":"Maximum number of IAM roles allowed. If missing or null, unlimited.","type":"integer"},"k2k_apps":{"description":"Maximum number of K2K apps allowed. If missing or null, unlimited.","type":"integer"}},"required":[]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/licence":{"get":{"description":"Returns HQ's licence.","operationId":"getLicence","responses":{"200":{"description":"Successfully returns licence response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Licence"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_licence"]}}}}
```

## GET /api/v1/licence-summary

> Returns HQ's licence summary.

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"hq_licence","description":"License information and management"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"hq_LicenceSummary":{"type":"object","description":"Models a compact licence.","properties":{"is_community":{"type":"boolean","description":"Is true when the licence is a community one, false otherwise."}},"required":["is_community"]},"hq_Error":{"type":"object","description":"Implements the RFC7807 \"Problem Details\", see https://www.rfc-editor.org/rfc/rfc7807.","properties":{"type":{"$ref":"#/components/schemas/hq_ErrorType"},"title":{"description":"Describes the problem in a human readable fashion.","type":"string"},"status":{"description":"Is a copy of the http status code.","type":"integer"},"invalid_fields":{"description":"Lists for validation errors the fields that failed validation.","type":"array","items":{"$ref":"#/components/schemas/hq_InvalidField"}},"sso_url":{"description":"Contains in case of an \"unauthorised\" type of error, the url of the SSO provider, if any.","type":"string"},"request_id":{"description":"Is set to the id of this request. Can be used to correlate backend logs.","type":"string"}},"required":["status","title"]},"hq_ErrorType":{"type":"string","description":"Enumerates possible error types.","enum":["not_found","unauthorised","forbidden","internal_server_error","agent_rpc_error","missing_agent_capabilities","agent_not_connected","validation_error","invalid_metadata","missing_parameter","invalid_parameter","licence_limitation","ai_server_unavailable","conflict","unspecified"]},"hq_InvalidField":{"type":"object","properties":{"name":{"type":"string"},"error":{"$ref":"#/components/schemas/hq_FieldErrorType"},"title":{"type":"string"},"pointer":{"description":"Holds a RFC-6901 JSON Pointer.","type":"string"}},"required":["name","error","title"]},"hq_FieldErrorType":{"type":"string","description":"Enumerates field validation error types.","enum":["reference_not_found","not_unique","invalid_value","other_error"]}}},"paths":{"/api/v1/licence-summary":{"get":{"description":"Returns HQ's licence summary.","operationId":"getLicenceSummary","responses":{"200":{"description":"Successfully returns licence response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_LicenceSummary"}}}},"default":{"description":"Error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/hq_Error"}}}}},"tags":["hq_licence"]}}}}
```
