Create a workspace API key
client.Admin.APIKeys.New(ctx, body) (*AdminAPIKeyNewResponse, error)
POST/compute/v1/admin/api-keys
Create a workspace API key
Parameters
Returns
Create a workspace API key
package main
import (
"context"
"fmt"
"github.com/boltz-bio/boltz-api-go"
"github.com/boltz-bio/boltz-api-go/option"
)
func main() {
client := boltzapi.NewClient(
option.WithAPIKey("My API Key"),
)
apiKey, err := client.Admin.APIKeys.New(context.TODO(), boltzapi.AdminAPIKeyNewParams{
Name: "x",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", apiKey.Key)
}
{
"key": "key",
"key_details": {
"id": "id",
"allowed_ips": [
"string"
],
"created_at": "2019-12-27T18:11:19.117Z",
"expires_at": "2019-12-27T18:11:19.117Z",
"is_active": true,
"key_prefix": "key_prefix",
"key_type": "workspace",
"last_used_at": "2019-12-27T18:11:19.117Z",
"livemode": true,
"name": "name",
"workspace_id": "workspace_id"
}
}Returns Examples
{
"key": "key",
"key_details": {
"id": "id",
"allowed_ips": [
"string"
],
"created_at": "2019-12-27T18:11:19.117Z",
"expires_at": "2019-12-27T18:11:19.117Z",
"is_active": true,
"key_prefix": "key_prefix",
"key_type": "workspace",
"last_used_at": "2019-12-27T18:11:19.117Z",
"livemode": true,
"name": "name",
"workspace_id": "workspace_id"
}
}