curl --request POST \
--url https://api.whop.com/api/v1/companies/{parent_company_id}/api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"child_company_id": "<string>",
"name": "<string>",
"permissions": [
{
"actions": [
"<string>"
],
"grant": true,
"resources": [
"<string>"
]
}
],
"role": "owner"
}
'{
"id": "<string>",
"name": "<string>",
"secret_key": "<string>"
}Create an API key for a connected account (child company) owned by a parent company.
curl --request POST \
--url https://api.whop.com/api/v1/companies/{parent_company_id}/api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"child_company_id": "<string>",
"name": "<string>",
"permissions": [
{
"actions": [
"<string>"
],
"grant": true,
"resources": [
"<string>"
]
}
],
"role": "owner"
}
'{
"id": "<string>",
"name": "<string>",
"secret_key": "<string>"
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
The unique identifier of the parent platform company (e.g. 'biz_xxx').
Parameters for CreateChildCompanyApiKey
The unique identifier of the connected account to create the API key for (e.g. 'biz_xxx').
A human-readable name for the API key, such as 'Production API Key'.
Granular permission statements defining which actions this API key can perform. Either permissions or role must be provided.
Show child attributes
A system role to inherit permissions from (e.g. owner, admin, moderator). Either role or permissions must be provided.
owner, admin, moderator, sales_manager A successful response
An API key created for a child company, including the one-time secret key.
Was this page helpful?