Create Api Key
Create a new API key for the current user.
Returns a temporary plain key for the user to store securely. This is not stored in the database.
Args:
db (AsyncSession): The database session. api_key_in (schemas.APIKeyCreate): The API key creation data. user (schemas.User): The current user.
Returns:
schemas.APIKeyWithPlainKey: The created API key object, including the key.
Headers
x-api-key
Request
This endpoint expects an object.
expiration_date
Expiration date for the API key, defaults to 180 days from now
Response
Successful Response
id
key_prefix
organization
created_at
modified_at
expiration_date
created_by_email
modified_by_email
plain_key
last_used_date