API reference

Apps

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

Set a Secret

POST/v1/apps/secrets

Create or replace a secret in the secret store.

Body parameters

  • namestringRequired

    A name for the secret that's unique within the scope.

  • payloadstringRequired

    The plaintext secret value to be stored.

  • scopeobjectRequired

    Specifies 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
    • typestringRequired
      Possible values
      • account
      • user
    • userstring
  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • expires_atinteger

    The Unix timestamp for the expiry time of the secret, after which the secret deletes.

Returns

The apps.secret object.

POST /v1/apps/secrets
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"
Response
{
  "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

  • scopeobjectRequired

    Specifies 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
    • typestringRequired
      Possible values
      • account
      • user
    • userstring
  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of apps.secret objects.

GET /v1/apps/secrets
curl -G https://api.knoxapi.com/v1/apps/secrets \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode "scope[type]=account"
Response
{
  "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

  • namestringRequired

    A name for the secret that's unique within the scope.

  • scopeobjectRequired

    Specifies 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
    • typestringRequired
      Possible values
      • account
      • user
    • userstring
  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The apps.secret object.

POST /v1/apps/secrets/delete
curl https://api.knoxapi.com/v1/apps/secrets/delete \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d name=test-secret \
  -d "scope[type]=account"
Response
{
  "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

  • namestringRequired

    A name for the secret that's unique within the scope.

  • scopeobjectRequired

    Specifies 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
    • typestringRequired
      Possible values
      • account
      • user
    • userstring
  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The apps.secret object.

GET /v1/apps/secrets/find
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"
Response
{
  "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.