curl --request POST \
--url https://api.snappy.com/public-api/v2/authentication/apiKeys \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "My API",
"expirationInDays": 90,
"enforceMtls": false
}
'{
"id": "abc123456",
"expirationDate": "2022-12-06T09:50:38.536Z",
"createdAt": "2022-12-06T09:50:38.536Z",
"enforceMtls": true,
"name": "My API key",
"companyId": "abc12345678",
"apiKey": "abc123456abc123454542343",
"permissions": [
"gifts:create"
],
"accountsAccess": {
"scope": "all-accounts",
"ids": [
"<string>"
]
}
}Create a new API key for the company. The API key is used to authenticate the company’s requests to the Snappy API.
curl --request POST \
--url https://api.snappy.com/public-api/v2/authentication/apiKeys \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "My API",
"expirationInDays": 90,
"enforceMtls": false
}
'{
"id": "abc123456",
"expirationDate": "2022-12-06T09:50:38.536Z",
"createdAt": "2022-12-06T09:50:38.536Z",
"enforceMtls": true,
"name": "My API key",
"companyId": "abc12345678",
"apiKey": "abc123456abc123454542343",
"permissions": [
"gifts:create"
],
"accountsAccess": {
"scope": "all-accounts",
"ids": [
"<string>"
]
}
}Documentation Index
Fetch the complete documentation index at: https://docs.snappy.com/llms.txt
Use this file to discover all available pages before exploring further.
Company level authentication provides access to all resources under your company, including accounts, campaigns, gifts, and recipients.
POST /v2/authentication/apiKeys endpoint to generate a new API keyInclude your API key in the X-Api-Key header for every request:
X-Api-Key: YOUR_24_CHARACTER_API_KEYFor production environments, enable mutual TLS authentication:
enforceMtls: true when creating the API keyhttps://mtls-api.snappy.com/public-apiSource of the request
api_native, api_zapier, api_salesforce, api_ftp, api_make "api_native"
Company ID
^[A-Za-z0-9]{8,}$"12345678"
Create API key request body.
The name of the API key. The name is used to identify the API key. The name must be unique.
1"My API"
API key expiration period in days. Valid values: 30, 60, 90, 180, 365. Default: 90 days.
0.00069 <= x <= 365If true, the API key will be enforced to use mTLS. If false, the API key will not be enforced to use mTLS. The default value is false.
true
The permissions of the API key.
gifts:create, gifts:create:demo, gifts:update, gifts:read:unmasked, gifts:read:masked, orders:create, orders:cancel, orders:read:unmasked, orders:read:masked, campaigns:create, campaigns:update, campaigns:read, collections:read, products:read, products:read:prices, recipients:create, recipients:update, recipients:read:unmasked, recipients:read:masked, recipients:delete, accounts:create, accounts:read Ok
API key object.
The API key id
"abc123456"
The date the API key will expire. Date Format: YYYY-MM-DDThh:mm:ss.sZ.
"2022-12-06T09:50:38.536Z"
The date the API key was created. Date Format: YYYY-MM-DDThh:mm:ss.sZ.
"2022-12-06T09:50:38.536Z"
If true, the API key will be enforced to use mTLS. If false, the API key will not be enforced to use mTLS.
true
The name of the API key
"My API key"
The company id
"abc12345678"
The API key
^[a-fA-F0-9]{24}$"abc123456abc123454542343"
The permissions of the API key.
gifts:create, gifts:create:demo, gifts:update, gifts:read:unmasked, gifts:read:masked, orders:create, orders:cancel, orders:read:unmasked, orders:read:masked, campaigns:create, campaigns:update, campaigns:read, collections:read, products:read, products:read:prices, recipients:create, recipients:update, recipients:read:unmasked, recipients:read:masked, recipients:delete, accounts:create, accounts:read The accounts access of the API key.
Show child attributes
Was this page helpful?