Skip to content

Create an API key

Request

Create a new API key bound to your current team. The returned last_token is the actual JWT to use in the Authorization: Bearer <token> header on subsequent requests. Tokens have a 3-year expiry.

Important: save the token immediately — it is only returned in this response and cannot be retrieved later.

Security
bearerAuth
Bodyapplication/jsonrequired
namestringrequired

Human-readable name for the API key.

Example:"production-integration"
POST
/id/api/jwt-tokens/create-api-key
curl -i -X POST \
  https://leadgen.grinfi.io/id/api/jwt-tokens/create-api-key \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "production-integration"
  }'

Responses

API key created.

Bodyapplication/json
jtistring

JWT ID. Use this to identify the key.

Example:"mnsPNOxciRqSNFec"
user_idinteger
Example:20
team_idinteger or null
Example:134
namestring
Example:"production-integration"
last_tokenstring

The actual JWT token. Pass this in Authorization: Bearer <token>. Save it immediately — it cannot be retrieved later.

created_atstring, (date-time)
Response
{ "jti": "mnsPNOxciRqSNFec", "user_id": 20, "team_id": 134, "name": "production-integration", "last_token": "string", "created_at": "2019-08-24T14:15:22Z" }