cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/secrets/api/keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"service_account_id": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.secrets.create_api_key(name="<value>", type_="publishable_key")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.secrets.createApiKey({
name: "<value>",
type: "publishable_key",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Secrets.CreateAPIKey(ctx, types.CreateAPIKeyRequest{
Name: "<value>",
Type: types.SecretTypePublishableKey,
})
if err != nil {
log.Fatal(err)
}
if res.CreateAPIKeyResponse != nil {
// handle response
}
}{
"api_key": "<string>",
"secret": {
"created_at": "2023-11-07T05:31:56Z",
"display_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"last_used_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"provider": "flexprice",
"roles": [
"<string>"
],
"service_account_name": "<string>",
"status": "published",
"type": "private_key",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"user_type": "user"
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Secrets
Create a new API key
Use when issuing a new API key (e.g. for a service account or for the current user). Provide service_account_id to create for a service account.
POST
/
secrets
/
api
/
keys
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/secrets/api/keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"service_account_id": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.secrets.create_api_key(name="<value>", type_="publishable_key")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.secrets.createApiKey({
name: "<value>",
type: "publishable_key",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Secrets.CreateAPIKey(ctx, types.CreateAPIKeyRequest{
Name: "<value>",
Type: types.SecretTypePublishableKey,
})
if err != nil {
log.Fatal(err)
}
if res.CreateAPIKeyResponse != nil {
// handle response
}
}{
"api_key": "<string>",
"secret": {
"created_at": "2023-11-07T05:31:56Z",
"display_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"last_used_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"provider": "flexprice",
"roles": [
"<string>"
],
"service_account_name": "<string>",
"status": "published",
"type": "private_key",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"user_type": "user"
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
API key creation request

