cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "<string>",
"name": "<string>",
"roles": [
"<string>"
]
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.users.create_user(type_="user")
# 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.users.createUser({
type: "user",
});
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.Users.CreateUser(ctx, types.CreateUserRequest{
Type: types.UserTypeUser,
})
if err != nil {
log.Fatal(err)
}
if res.CreateUserResponse != nil {
// handle response
}
}{
"email": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"password": "<string>",
"roles": [
"<string>"
],
"tenant": {
"billing_details": {
"address": {
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>"
},
"email": "<string>",
"help_email": "<string>",
"phone": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"name": "<string>",
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"type": "user"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Users
Create user or service account
Create a user account (type=user, email required; returns user + password for login) or a service account (type=service_account, roles required) for API/automation access.
POST
/
users
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "<string>",
"name": "<string>",
"roles": [
"<string>"
]
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.users.create_user(type_="user")
# 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.users.createUser({
type: "user",
});
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.Users.CreateUser(ctx, types.CreateUserRequest{
Type: types.UserTypeUser,
})
if err != nil {
log.Fatal(err)
}
if res.CreateUserResponse != nil {
// handle response
}
}{
"email": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"password": "<string>",
"roles": [
"<string>"
],
"tenant": {
"billing_details": {
"address": {
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>"
},
"email": "<string>",
"help_email": "<string>",
"phone": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"name": "<string>",
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"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
Create user (email, type=user) or service account (type=service_account, roles)

