POST
/
api
/
users
/
create
import requests

url = "https://api.keywordsai.co/api/users/create/"
api_key = "YOUR_KEY" # Replace with your actual Keywords AI API key
data = {
    "period_budget": 30,
    "customer_identifier": "some_customer_identifier"
}
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

User creation endpoint allows you to create users and keep track of their usage/budget/limits.

Make sure to replace YOUR_KEYWORDSAI_API_KEY with your actual Keywords AI API key.

customer_identifier
string
required

The unique identifier for the user.

name
string

User’s name.

email
string

User’s email address.

period_start
string

The start of the budget period in ISO Format: YYYY-MM-DD (e.g. 2024-03-09). If not provided, the current date will be used.

This field will automatically roll over to the next period if the current date is past the end of the period.

period_end
string

The end of the budget period in ISO Format: YYYY-MM-DD (e.g. 2024-03-09). If not provided, it will be set based on the period_start + budget_duration. (e.g. 2024-03-09 + 1 month = 2024-04-09)

This field will automatically roll over to the next period if the current date is past the end of the period.

budget_duration
string

Type of budget duration. Possible values are daily, weekly, monthly, and yearly. The default value is monthly.

period_budget
number

The budget amount for the period. The default value is null, which means no budget is set.

markup_percentage
number

This allows a User’s usage to be reported more by x%. The default value is 0.

  {
    "markup_percentage": 30 // 30% extra on top of the usage  
  }
metadata
object

Customized metadata for the user. Any key-value pairs can be added here.

import requests

url = "https://api.keywordsai.co/api/users/create/"
api_key = "YOUR_KEY" # Replace with your actual Keywords AI API key
data = {
    "period_budget": 30,
    "customer_identifier": "some_customer_identifier"
}
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())