All URIs are relative to http://localhost:3000
| Method | HTTP request | Description |
|---|---|---|
| create_api_key | POST /v1/api-keys | Create an API Key |
| delete_api_key | DELETE /v1/api-keys/{id} | Delete an API Key |
| list_api_keys | GET /v1/api-keys | List API Keys |
APIKeyCreatedResponse create_api_key(create_api_key_request)
Create an API Key
Generates a new programmatic API key for accessing authorized resources. The full, secret API key is returned ONLY once in this response and cannot be recovered later.
- Bearer Authentication (BearerAuth):
import px0
from px0.models.api_key_created_response import APIKeyCreatedResponse
from px0.models.create_api_key_request import CreateAPIKeyRequest
from px0.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = px0.Configuration(
host = "http://localhost:3000"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = px0.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with px0.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = px0.APIKeysApi(api_client)
create_api_key_request = px0.CreateAPIKeyRequest() # CreateAPIKeyRequest |
try:
# Create an API Key
api_response = api_instance.create_api_key(create_api_key_request)
print("The response of APIKeysApi->create_api_key:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling APIKeysApi->create_api_key: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_api_key_request | CreateAPIKeyRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | API key created successfully | - |
| 400 | Invalid request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_api_key(id)
Delete an API Key
Revokes and permanently deletes an API key by its unique UUID.
- Bearer Authentication (BearerAuth):
import px0
from px0.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = px0.Configuration(
host = "http://localhost:3000"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = px0.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with px0.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = px0.APIKeysApi(api_client)
id = 'id_example' # str | The unique UUID of the API Key to delete.
try:
# Delete an API Key
api_instance.delete_api_key(id)
except Exception as e:
print("Exception when calling APIKeysApi->delete_api_key: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The unique UUID of the API Key to delete. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | API key successfully deleted | - |
| 400 | Invalid UUID format | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | API key not found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListAPIKeys200Response list_api_keys(org_id)
List API Keys
Lists metadata for all programmatic API keys. Secret key values are omitted.
- Bearer Authentication (BearerAuth):
import px0
from px0.models.list_api_keys200_response import ListAPIKeys200Response
from px0.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = px0.Configuration(
host = "http://localhost:3000"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = px0.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with px0.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = px0.APIKeysApi(api_client)
org_id = 'org_id_example' # str |
try:
# List API Keys
api_response = api_instance.list_api_keys(org_id)
print("The response of APIKeysApi->list_api_keys:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling APIKeysApi->list_api_keys: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| org_id | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List of API keys | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]