Skip to main content
POST
/
api_keys
Create
curl --request POST \
  --url https://api.ngrok.com/api_keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'ngrok-version: <ngrok-version>' \
  --data '{
  "description": "<string>",
  "metadata": "<string>",
  "owner_id": "<string>"
}'
{
  "id": "<string>",
  "uri": "<string>",
  "description": "<string>",
  "metadata": "<string>",
  "created_at": "<string>",
  "token": "<string>",
  "owner_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

ngrok-version
integer
default:2
required

Body

application/json
description
string

human-readable description of what uses the API key to authenticate. optional, max 255 bytes.

metadata
string

arbitrary user-defined data of this API key. optional, max 4096 bytes

owner_id
string

If supplied at credential creation, ownership will be assigned to the specified User or Bot. Only admins may specify an owner other than themselves. Defaults to the authenticated User or Bot.

Response

201 - application/json

Create a new API key. The generated API key can be used to authenticate to the ngrok API.

id
string

unique API key resource identifier

uri
string

URI to the API resource of this API key

description
string

human-readable description of what uses the API key to authenticate. optional, max 255 bytes.

metadata
string

arbitrary user-defined data of this API key. optional, max 4096 bytes

created_at
string

timestamp when the api key was created, RFC 3339 format

token
string

the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.

owner_id
string

If supplied at credential creation, ownership will be assigned to the specified User or Bot. Only admins may specify an owner other than themselves. Defaults to the authenticated User or Bot.