(apis)
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.apis.get(api_id="api_1234")
if res.object is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
Example |
api_id |
str |
✔️ |
N/A |
api_1234 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.GetAPIResponse
Error Type |
Status Code |
Content Type |
models.ErrBadRequest |
400 |
application/json |
models.ErrUnauthorized |
401 |
application/json |
models.ErrForbidden |
403 |
application/json |
models.ErrNotFound |
404 |
application/json |
models.ErrConflict |
409 |
application/json |
models.ErrTooManyRequests |
429 |
application/json |
models.ErrInternalServerError |
500 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.apis.create(request={
"name": "my-api",
})
if res.object is not None:
# handle response
pass
models.CreateAPIResponse
Error Type |
Status Code |
Content Type |
models.ErrBadRequest |
400 |
application/json |
models.ErrUnauthorized |
401 |
application/json |
models.ErrForbidden |
403 |
application/json |
models.ErrNotFound |
404 |
application/json |
models.ErrConflict |
409 |
application/json |
models.ErrTooManyRequests |
429 |
application/json |
models.ErrInternalServerError |
500 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.apis.list_keys(request={
"api_id": "api_1234",
"limit": 100,
})
if res.object is not None:
# handle response
pass
models.ListKeysResponse
Error Type |
Status Code |
Content Type |
models.ErrBadRequest |
400 |
application/json |
models.ErrUnauthorized |
401 |
application/json |
models.ErrForbidden |
403 |
application/json |
models.ErrNotFound |
404 |
application/json |
models.ErrConflict |
409 |
application/json |
models.ErrTooManyRequests |
429 |
application/json |
models.ErrInternalServerError |
500 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.apis.delete(request={
"api_id": "api_1234",
})
if res.object is not None:
# handle response
pass
models.DeleteAPIResponse
Error Type |
Status Code |
Content Type |
models.ErrBadRequest |
400 |
application/json |
models.ErrUnauthorized |
401 |
application/json |
models.ErrForbidden |
403 |
application/json |
models.ErrNotFound |
404 |
application/json |
models.ErrConflict |
409 |
application/json |
models.ErrDeleteProtected |
429 |
application/json |
models.ErrInternalServerError |
500 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.apis.delete_keys(request={
"api_id": "api_1234",
})
if res.object is not None:
# handle response
pass
models.DeleteKeysResponse
Error Type |
Status Code |
Content Type |
models.ErrBadRequest |
400 |
application/json |
models.ErrUnauthorized |
401 |
application/json |
models.ErrForbidden |
403 |
application/json |
models.ErrNotFound |
404 |
application/json |
models.ErrConflict |
409 |
application/json |
models.ErrTooManyRequests |
429 |
application/json |
models.ErrInternalServerError |
500 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |