https://api.knoxapi.comSet a Secret
POST/v1/apps/secrets
Create or replace a secret in the secret store.
Body parameters
namestringRequiredA name for the secret that's unique within the scope.
payloadstringRequiredThe plaintext secret value to be stored.
scopeobjectRequiredSpecifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Show 2 child parameters
typestringRequiredPossible valuesaccountuser
userstring
expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atintegerThe Unix timestamp for the expiry time of the secret, after which the secret deletes.
Returns
The apps.secret object.
curl https://api.knoxapi.com/v1/apps/secrets \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d name=test-secret \
-d payload=example \
-d "scope[type]=account"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/apps/secrets', {
name: 'test-secret',
payload: 'example',
scope: {
type: 'account',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/apps/secrets", name="test-secret", payload="example", scope={
"type": "account",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/apps/secrets', {
name: 'test-secret',
payload: 'example',
scope: {
type: 'account',
},
}){
"created": 1234567890,
"expires_at": 1234567890,
"id": "appsecret_5110QzMIZ0005GiEH1m0419O8KAxCG",
"livemode": false,
"name": "test-secret",
"object": "apps.secret",
"scope": {
"type": "account"
}
}List secrets
GET/v1/apps/secrets
List all secrets stored on the given scope.
Query parameters
scopeobjectRequiredSpecifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Show 2 child parameters
typestringRequiredPossible valuesaccountuser
userstring
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of apps.secret objects.
curl -G https://api.knoxapi.com/v1/apps/secrets \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode "scope[type]=account"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/apps/secrets', {
scope: {
type: 'account',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/apps/secrets", scope={
"type": "account",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/apps/secrets', {
scope: {
type: 'account',
},
}){
"object": "list",
"url": "/v1/apps/secrets",
"has_more": false,
"data": [
{
"created": 1234567890,
"expires_at": 1234567890,
"id": "appsecret_5110QzMIZ0005GiEH1m0419O8KAxCG",
"livemode": false,
"name": "test-secret",
"object": "apps.secret",
"scope": {
"type": "account"
}
}
]
}Delete a Secret
POST/v1/apps/secrets/delete
Deletes a secret from the secret store by name and scope.
Body parameters
namestringRequiredA name for the secret that's unique within the scope.
scopeobjectRequiredSpecifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Show 2 child parameters
typestringRequiredPossible valuesaccountuser
userstring
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The apps.secret object.
curl https://api.knoxapi.com/v1/apps/secrets/delete \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d name=test-secret \
-d "scope[type]=account"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/apps/secrets/delete', {
name: 'test-secret',
scope: {
type: 'account',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/apps/secrets/delete", name="test-secret", scope={
"type": "account",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/apps/secrets/delete', {
name: 'test-secret',
scope: {
type: 'account',
},
}){
"created": 1234567890,
"expires_at": 1234567890,
"id": "appsecret_5110QzMIZ0005GiEH1m0419O8KAxCG",
"livemode": false,
"name": "test-secret",
"object": "apps.secret",
"scope": {
"type": "account"
}
}Find a Secret
GET/v1/apps/secrets/find
Finds a secret in the secret store by name and scope.
Query parameters
namestringRequiredA name for the secret that's unique within the scope.
scopeobjectRequiredSpecifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.
Show 2 child parameters
typestringRequiredPossible valuesaccountuser
userstring
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The apps.secret object.
curl -G https://api.knoxapi.com/v1/apps/secrets/find \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode name=test-secret \
--data-urlencode "scope[type]=account"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/apps/secrets/find', {
name: 'test-secret',
scope: {
type: 'account',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/apps/secrets/find", name="test-secret", scope={
"type": "account",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/apps/secrets/find', {
name: 'test-secret',
scope: {
type: 'account',
},
}){
"created": 1234567890,
"expires_at": 1234567890,
"id": "appsecret_5110QzMIZ0005GiEH1m0419O8KAxCG",
"livemode": false,
"name": "test-secret",
"object": "apps.secret",
"scope": {
"type": "account"
}
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.