Skip to main content

Generate API Key

POST/api/v1/lead_providers/{id}/generate_api_key/

Generates a new API key (credential) for a specific provider.

Auth: Admin JWT + IsAdminOnlyPosition.

Path parameter​

ParameterTypeDescription
idIntegerProvider ID

Body fields​

FieldTypeRequiredDescription
nameStringOptionalKey name ("Production", "Sandbox"). Default: "default"

Response — 200 / 201​

{
"api_key": "lp_live_7f2a91_r3vS6gG8-QzM5h...",
"credential_id": 1,
"key_prefix": "7f2a91"
}
FieldDescription
api_keyThe full key to hand to the provider
credential_idThe key record ID (for managing keys)
key_prefixThe public prefix of the key (for identification; not secret)

:::warning Handle the key securely Deliver the key to the provider over a secure channel (avoid plain email/chat). Anyone holding the key can submit leads as that provider. The key remains viewable in the Navigo CRM, so it can be retrieved again later; if it is compromised, generate a new one and revoke the old one. :::

Code samples​

curl -X POST https://api.navigocrm.com/api/v1/lead_providers/1/generate_api_key/ \
-H "Authorization: Bearer $NAVIGO_ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{"name": "Production"}'

Possible errors​

StatusReason
404No provider with this id
401JWT is invalid
403No admin position

Full format: Errors.