(identities)
from unkey_py import Unkey
with Unkey(
bearer_auth="UNKEY_ROOT_KEY",
) as s:
res = s.identities.create(request={
"external_id": "user_123",
"ratelimits": [
{
"name": "tokens",
"limit": 10,
"duration": 1000,
},
{
"name": "tokens",
"limit": 10,
"duration": 1000,
},
],
})
if res.object is not None:
# handle response
pass
models.CreateIdentityResponse
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 |
*/* |
from unkey_py import Unkey
with Unkey(
bearer_auth="UNKEY_ROOT_KEY",
) as s:
res = s.identities.get(identity_id="id_1234", external_id="id_1234")
if res.object is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
Example |
identity_id |
Optional[str] |
➖ |
N/A |
id_1234 |
external_id |
Optional[str] |
➖ |
N/A |
id_1234 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.GetIdentityResponse
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 |
*/* |
from unkey_py import Unkey
with Unkey(
bearer_auth="UNKEY_ROOT_KEY",
) as s:
res = s.identities.list(limit=100)
if res.object is not None:
while True:
# handle items
res = res.next()
if res is None:
break
Parameter |
Type |
Required |
Description |
Example |
environment |
Optional[str] |
➖ |
N/A |
|
limit |
Optional[int] |
➖ |
N/A |
100 |
cursor |
Optional[str] |
➖ |
N/A |
|
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.ListIdentitiesResponse
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 |
*/* |
from unkey_py import Unkey
with Unkey(
bearer_auth="UNKEY_ROOT_KEY",
) as s:
res = s.identities.update(request={
"identity_id": "id_1234",
"external_id": "user_1234",
"ratelimits": [
{
"name": "tokens",
"limit": 10,
"duration": 1000,
},
{
"name": "tokens",
"limit": 10,
"duration": 1000,
},
{
"name": "tokens",
"limit": 10,
"duration": 1000,
},
],
})
if res.object is not None:
# handle response
pass
models.UpdateIdentityResponse
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 |
*/* |
from unkey_py import Unkey
with Unkey(
bearer_auth="UNKEY_ROOT_KEY",
) as s:
res = s.identities.delete(request={
"identity_id": "id_1234",
})
if res.object is not None:
# handle response
pass
models.DeleteIdentityResponse
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 |
*/* |