API keys authenticate server-to-server calls. Pass the secret in theDocumentation Index
Fetch the complete documentation index at: https://docs.sdk.anghami.com/llms.txt
Use this file to discover all available pages before exploring further.
x-api-key header. Keys can browse the public catalog but cannot acquire streams or read user libraries — for those, use OAuth (see Authentication).
Lifecycle
Creating
ListApiKeys and GetApiKey only return the key_prefix (first ~8 chars) for identification — never the full secret.
Rotating
Rotate when you suspect leakage, before a teammate offboards, or on a regular schedule.- Call
RotateApiKeyand capture the new secret. - Roll the new secret through your config system.
- Wait for all your servers to be using the new secret.
- The old secret expires automatically at the end of the grace window.
Revoking
CreateApiKey.
Naming and hygiene
- Use one key per environment (
my-app-prod,my-app-staging,my-app-ci). Don’t share. - Prefix names with a clear owner so
ListApiKeysis auditable. - Rotate on a schedule (90 days is a reasonable default).
- Never log full secrets. The
key_prefixis safe to log for correlation. - Never check secrets into git. The portal enforces single-fetch by design — if you need the secret again, rotate.
Errors
ERROR_CODE_NOT_FOUNDon rotate/revoke — the key ID doesn’t exist or you don’t own it.ERROR_CODE_CONFLICTon revoke — the key is already revoked.ERROR_CODE_PERMISSION_DENIEDon any developer call — your OAuth token isn’t authenticated as the key’s owner.