---
updatedAt: 2026-01-16T23:01:08.000Z
agentTools:
  projectIndex: https://docs.nmi.com/llms.txt
---

# Create Merchant API Keys

```shell Shell
curl --request POST \
     --url https://sandbox.nmi.com/api/v4/merchants/gateway_id/security_keys \
     --header 'Authorization: your-key-here' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
     --data '
{
  "userId": "123456",
  "description": "Key for API Access",
  "permissions": [
    "transaction"
  ]
}
'

curl --request POST \
     --url https://sandbox.nmi.com/api/v4/merchants/gateway_id/security_keys \
     --header 'Authorization: your-key-here' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
     --data '
{
  "description": "Key for Collect.js Access",
  "permissions": [
    "tokenization"
  ]
}
'
```

```json Response Example
{"success":true}
```

# Specify a User

<!-- shell@8 -->

The `userId` is optional, and will default to the primary user on the account if it is not provided.

# Create an API Key

<!-- shell@2,10-12 -->

Using the `ID` from the Create Merchant response in place of the `gateway_id` in the request URL you will create a new API key for a user on a merchant account.

Keys with the `transaction` permission are secure, private keys that authenticate a specific merchant user.

# Create a Tokenization Key

<!-- shell@25-27 -->

Keys with the `tokenization` permission are insecure, public keys that allow a specific merchant user to access features like our Tokenization library.